mirror of
				https://github.com/videojs/video.js.git
				synced 2025-10-31 00:08:01 +02:00 
			
		
		
		
	Updated demo videos.
Added function to dectect video support and not load controls.
This commit is contained in:
		
							
								
								
									
										15
									
								
								demo.html
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								demo.html
									
									
									
									
									
								
							| @@ -16,16 +16,17 @@ | |||||||
| <body id="body" onload="bodyLoaded()"> | <body id="body" onload="bodyLoaded()"> | ||||||
|  |  | ||||||
|   <div class="video-box"> |   <div class="video-box"> | ||||||
|     <!-- Using the Video for Everybody Embed Code http://camendesign.com/code/video_for_everybody --> |     <!-- Using the Video for Everybody Embed Code (modified for VP8/WebM) http://camendesign.com/code/video_for_everybody --> | ||||||
|     <video id="video" class="video-js" width="640" height="360" poster="http://zencoder-demo.s3.amazonaws.com/poster.jpg" autobuffer> |     <video id="video" class="video-js" width="640" height="264" poster="http://video-js.s3.amazonaws.com/oceans-clip.png" autobuffer> | ||||||
|       <source src="http://zencoder-demo.s3.amazonaws.com/trailer_test.mp4" type="video/mp4"></source> |       <source src="http://video-js.s3.amazonaws.com/oceans-clip.mp4" type="video/mp4"></source> | ||||||
|       <source src="http://zencoder-demo.s3.amazonaws.com/trailer_test.ogg" type="video/ogg"></source> |       <source src="http://video-js.s3.amazonaws.com/oceans-clip.webm" type="video/webm"></source> | ||||||
|       <object width="640" height="360" type="application/x-shockwave-flash" |       <source src="http://video-js.s3.amazonaws.com/oceans-clip.ogg" type="video/ogg"></source> | ||||||
|  |       <object width="640" height="264" type="application/x-shockwave-flash" | ||||||
|         data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf"> |         data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf"> | ||||||
|         <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" /> |         <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" /> | ||||||
|         <param name="allowfullscreen" value="true" /> |         <param name="allowfullscreen" value="true" /> | ||||||
|         <param name="flashvars" value='config={"clip":"http://zencoder-demo.s3.amazonaws.com/trailer_test.mp4"}' /> |         <param name="flashvars" value='config={"clip":"http://video-js.s3.amazonaws.com/oceans-clip.mp4"}' /> | ||||||
|         <img src="http://zencoder-demo.s3.amazonaws.com/poster.jpg" width="640" height="360" alt="Poster Image" title="No video playback capabilities." /> |         <img src="http://video-js.s3.amazonaws.com/oceans-clip.png" width="640" height="264" alt="Poster Image" title="No video playback capabilities." /> | ||||||
|       </object> |       </object> | ||||||
|     </video> |     </video> | ||||||
|   </div> |   </div> | ||||||
|   | |||||||
							
								
								
									
										18
									
								
								video.js
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								video.js
									
									
									
									
									
								
							| @@ -380,10 +380,20 @@ var VideoJS = Class.extend({ | |||||||
|  |  | ||||||
| // Add video-js to any video tag with the class | // Add video-js to any video tag with the class | ||||||
| VideoJS.setup = function(){ | VideoJS.setup = function(){ | ||||||
|   var videoTags = document.getElementsByTagName("video"); |   if (VideoJS.supportsVideo()) { | ||||||
|   for (var i=0;i<videoTags.length;i++) { |     var videoTags = document.getElementsByTagName("video"); | ||||||
|     if (videoTags[i].className.indexOf("video-js") != -1) { |     for (var i=0;i<videoTags.length;i++) { | ||||||
|       videoJSPlayers[i] = new VideoJS(document.getElementById("video"), i); |       if (videoTags[i].className.indexOf("video-js") != -1) { | ||||||
|  |         videoJSPlayers[i] = new VideoJS(document.getElementById("video"), i); | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | // Check if the browser supports video. | ||||||
|  | VideoJS.supportsVideo = function() { | ||||||
|  |   return !!document.createElement('video').canPlayType; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user