[xiph-commits] r15719 - websites/celt-codec.org/presentations

gmaxwell at svn.xiph.org gmaxwell at svn.xiph.org
Tue Feb 24 16:36:25 PST 2009


Author: gmaxwell
Date: 2009-02-24 16:36:25 -0800 (Tue, 24 Feb 2009)
New Revision: 15719

Modified:
   websites/celt-codec.org/presentations/video.js
Log:
video.js support for multiple videos

Modified: websites/celt-codec.org/presentations/video.js
===================================================================
--- websites/celt-codec.org/presentations/video.js	2009-02-25 00:00:44 UTC (rev 15718)
+++ websites/celt-codec.org/presentations/video.js	2009-02-25 00:36:25 UTC (rev 15719)
@@ -3,7 +3,7 @@
 var videoElement = false;
 var oggPlugin = false;
 var javaEnabled = false;
-var theorahelperurl = "http://www.theora.org/"; 
+var theorahelperurl = "http://www.theora.org/";
 var cortadourl = '';
 
 function initVideo()
@@ -30,12 +30,12 @@
 		if (navigator.mimeTypes[i].type.indexOf("video/ogg") > -1) {
 		    oggPlugin = true;
 		}
-		if (navigator.mimeTypes[i].
-		    type.indexOf("application/x-vlc-plugin") > -1) {
+		if (navigator.mimeTypes[i].type.
+		    indexOf("application/x-vlc-plugin") > -1) {
 		    vlcPlugin = true;
 		}
-		if (navigator.mimeTypes[i].
-		    type.indexOf("application/x-java-applet") > -1) {
+		if (navigator.mimeTypes[i].type.
+		    indexOf("application/x-java-applet") > -1) {
 		    foundJavaMimeType = true;
 		}
 	    }
@@ -53,9 +53,10 @@
 	var videos = document.getElementsByTagName("video");
 
 	// replace all video elements with fallbacks
-	for (i = 0; i < videos.length; ++i) {
+	var i = 0;
+	while (videos.length > 0) {
 
-	    var video = videos[i];
+	    var video = videos[0];
 
 	    var src = video.getAttribute("src");
 	    var poster = video.getAttribute("poster");
@@ -66,14 +67,14 @@
 	    var duration = video.getAttribute("duration");
 	    var id = video.getAttribute("id");
 
-	    if (controls!=null)
+	    if (controls != null)
 		controls = "true";
 	    else
 		controls = "false";
 
-	    if ((autoplay==null) || !inlinePlayback)
+	    if ((autoplay == null) || !inlinePlayback)
 		autoplay = "false";
-	    else if (autoplay!=null)
+	    else if (autoplay != null)
 		autoplay = "true";
 	    if (autoplay == "false") {
 		autoplay = "true";
@@ -115,7 +116,7 @@
 
 		if (!inlinePlayback) {
 		    var div = document.createElement("div");
-		    div.setAttribute("align","center");
+		    div.setAttribute("align", "center");
 		    div.appendChild(posterobj);
 		    div.appendChild(document.createElement("br"));
 		    small = document.createElement("small");
@@ -140,6 +141,7 @@
 			  autoplay, javaEnabled, oggPlugin, vlcActiveX,
 			  vlcPlugin);
 	    }
+	    i++;
 	}
     }
 }



More information about the commits mailing list