[xiph-commits] r18157 - in websites/opus-codec.org: . presentations presentations/misc

jm at svn.xiph.org jm at svn.xiph.org
Fri Jan 20 01:34:30 PST 2012


Author: jm
Date: 2012-01-20 01:34:30 -0800 (Fri, 20 Jan 2012)
New Revision: 18157

Added:
   websites/opus-codec.org/presentations/
   websites/opus-codec.org/presentations/LCA-video-thumb.jpg
   websites/opus-codec.org/presentations/cortado.jar
   websites/opus-codec.org/presentations/index.shtml.en
   websites/opus-codec.org/presentations/misc/
   websites/opus-codec.org/presentations/misc/lca-opus-audio.tar.gz
   websites/opus-codec.org/presentations/misc/lca-opus.odp
   websites/opus-codec.org/presentations/misc/lca-opus.pdf
   websites/opus-codec.org/presentations/video.js
Log:
Adds LCA video


Added: websites/opus-codec.org/presentations/LCA-video-thumb.jpg
===================================================================
(Binary files differ)


Property changes on: websites/opus-codec.org/presentations/LCA-video-thumb.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: websites/opus-codec.org/presentations/cortado.jar
===================================================================
(Binary files differ)


Property changes on: websites/opus-codec.org/presentations/cortado.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: websites/opus-codec.org/presentations/index.shtml.en
===================================================================
--- websites/opus-codec.org/presentations/index.shtml.en	                        (rev 0)
+++ websites/opus-codec.org/presentations/index.shtml.en	2012-01-20 09:34:30 UTC (rev 18157)
@@ -0,0 +1,30 @@
+<!--#include virtual="/ssi/header.include" -->
+
+<style type="text/css">
+<!--
+#navlink_ a {
+	text-decoration: underline !important;
+}
+-->
+</style>
+<script src="video.js" type="text/javascript"></script>
+<script language="vbScript">
+on error resume next
+vlcActiveX = (IsObject(CreateObject("VideoLAN.VLCPlugin.2")))
+</script>
+</head>
+<body onload="initVideo();">
+<!--#include virtual="/common/xiphbar.include" -->
+<!--#include virtual="/ssi/pagetop.include" -->
+<!--  All your page content goes here  -->
+<h1>Presentations</h1>
+<h2><a href="http://linux.conf.au/">linux.conf.au</a> 2012 &mdash; Jean-Marc Valin</h2>
+  <table width="496" border="0"><tr><td><video id="lcaopusvideo" width="496" height="272"
+   poster="LCA-opus-video-thumb.jpg" controls duration="3892"
+   src="http://jmvalin.ca/jmvalin_Opus_codec.ogv"/></td></tr><tr>
+   <td align="left"><a href="http://jmvalin.ca/jmvalin_Opus_codec.ogv">Download video</a> <small>(Ogg/<a href="http://www.theora.org/">Theora</a>; 45 minutes; 222 MiB)</small><br/>
+   <a href="misc/lca-opus-audio.tar.gz">Audio/Video files</a> <small>(tar.gz; 10 MiB)</small><br/>
+   <a href="misc/lca-opus.odp">Audio samples</a> <small>(ODP; 679 KiB)</small><br/>
+   <a href="misc/lca-opus.pdf">Slides</a> <small>(PDF; 733 KiB)</small></td></tr></table>
+
+<!--#include virtual="/ssi/footer.include" -->

Added: websites/opus-codec.org/presentations/misc/lca-opus-audio.tar.gz
===================================================================
(Binary files differ)


Property changes on: websites/opus-codec.org/presentations/misc/lca-opus-audio.tar.gz
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: websites/opus-codec.org/presentations/misc/lca-opus.odp
===================================================================
(Binary files differ)


Property changes on: websites/opus-codec.org/presentations/misc/lca-opus.odp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: websites/opus-codec.org/presentations/misc/lca-opus.pdf
===================================================================
(Binary files differ)


Property changes on: websites/opus-codec.org/presentations/misc/lca-opus.pdf
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: websites/opus-codec.org/presentations/video.js
===================================================================
--- websites/opus-codec.org/presentations/video.js	                        (rev 0)
+++ websites/opus-codec.org/presentations/video.js	2012-01-20 09:34:30 UTC (rev 18157)
@@ -0,0 +1,247 @@
+var vlcActiveX = false;
+var vlcPlugin = false;
+var videoElement = false;
+var oggPlugin = false;
+var javaEnabled = false;
+var theorahelperurl = "http://www.theora.org/";
+var cortadourl = '';
+
+function initVideo()
+{
+
+    var video = document.createElement("video");
+
+    if ((video.canPlayType
+	 && video.canPlayType("video/ogg;codecs=\"theora,vorbis\"") ==
+	 "probably") || (!video.canPlayType && video.play)) {
+	videoElement = true;
+    }
+
+    if (!videoElement) {
+	var searchedMimeTypes = false;
+	var foundJavaMimeType = false;
+
+	// search for MIME-types
+	if (navigator.mimeTypes && navigator.mimeTypes.length > 0) {
+
+	    searchedMimeTypes = true;
+
+	    for (var i = 0; i < navigator.mimeTypes.length; i++) {
+		if (navigator.mimeTypes[i].type.indexOf("video/ogg") > -1) {
+		    oggPlugin = true;
+		}
+		if (navigator.mimeTypes[i].type.
+		    indexOf("application/x-vlc-plugin") > -1) {
+		    vlcPlugin = true;
+		}
+		if (navigator.mimeTypes[i].type.
+		    indexOf("application/x-java-applet") > -1) {
+		    foundJavaMimeType = true;
+		}
+	    }
+	}
+
+
+	if (searchedMimeTypes) {
+	    javaEnabled = navigator.javaEnabled() && foundJavaMimeType;
+	} else {
+	    javaEnabled = navigator.javaEnabled();
+	}
+
+	var inlinePlayback = vlcActiveX || vlcPlugin || oggPlugin
+	    || javaEnabled;
+
+	var videos = document.getElementsByTagName("video");
+
+	// replace all video elements with fallbacks
+	var i = 0;
+	while (videos.length > 0) {
+
+	    var video = videos[0];
+
+	    var src = video.getAttribute("src");
+	    var poster = video.getAttribute("poster");
+	    var width = video.getAttribute("width");
+	    var height = video.getAttribute("height");
+	    var controls = video.getAttribute("controls");
+	    var autoplay = video.getAttribute("autoplay");
+	    var duration = video.getAttribute("duration");
+	    var id = video.getAttribute("id");
+
+	    if (controls != null)
+		controls = "true";
+	    else
+		controls = "false";
+
+	    if ((autoplay == null) || !inlinePlayback)
+		autoplay = "false";
+	    else if (autoplay != null)
+		autoplay = "true";
+	    if (autoplay == "false") {
+		autoplay = "true";
+		var posterid = id + "_poster_" + i;
+		var jsexec = "swapVideo(document.getElementById('"
+		    + posterid + "'),'" + src + "','" +
+		    width + "','" + height + "','" +
+		    controls + "','" + duration + "','" + autoplay +
+		    "','" + javaEnabled + "','" +
+		    oggPlugin + "','" + vlcActiveX + "','" + vlcPlugin +
+		    "');";
+		if (poster) {
+		    var posterobj = document.createElement("img");
+		    posterobj.setAttribute("id", posterid);
+		    posterobj.setAttribute("src", poster);
+		    posterobj.setAttribute("width", width);
+		    posterobj.setAttribute("height", height);
+		    if (inlinePlayback) {
+			posterobj.setAttribute("onclick", jsexec);
+		    } else {
+			var link = document.createElement("a");
+			link.setAttribute("href", src);
+			link.appendChild(posterobj);
+			posterobj = link;
+		    }
+		} else {
+		    var posterobj = document.createElement("span");
+		    posterobj.setAttribute("id", posterid);
+		    var link = document.createElement("a");
+		    if (inlinePlayback) {
+			link.setAttribute("href", "javascript:" + jsexec);
+		    } else {
+			link.setAttribute("href", src);
+		    }
+		    var text = document.createTextNode("> Play video <");
+		    link.appendChild(text);
+		    posterobj.appendChild(link);
+		}
+
+		if (!inlinePlayback) {
+		    var div = document.createElement("div");
+		    div.setAttribute("align", "center");
+		    div.appendChild(posterobj);
+		    div.appendChild(document.createElement("br"));
+		    small = document.createElement("small");
+		    small.setAttribute("class", "small");
+		    text = document.createTextNode(" (");
+		    small.appendChild(text);
+		    link = document.createElement("a");
+		    link.setAttribute("href", theorahelperurl);
+		    text = document.createTextNode("Ogg/Theora");
+		    link.appendChild(text);
+		    small.appendChild(link);
+		    text = document.createTextNode(" required)");
+		    small.appendChild(text);
+		    div.appendChild(small);
+		    posterobj = div;
+		}
+
+		video.parentNode.replaceChild(posterobj, video);
+
+	    } else {
+		swapVideo(video, src, width, height, controls, duration,
+			  autoplay, javaEnabled, oggPlugin, vlcActiveX,
+			  vlcPlugin);
+	    }
+	    i++;
+	}
+    }
+}
+
+function swapVideo(video, src, width, height, controls, duration, autoplay,
+		   javaEnabled, oggPlugin, vlcActiveX, vlcPlugin)
+{
+    var parent = video.parentNode;
+    var containerdiv = document.createElement("div");
+    containerdiv.setAttribute("width", width);
+    containerdiv.setAttribute("height", height);
+    if (javaEnabled=="true") {
+	if (cortadourl == '') {
+	    cortadourl = cortadourl + 'cortado.jar';
+	}
+	var applet = document.createElement("applet");
+	applet.setAttribute("code", "com.fluendo.player.Cortado.class");
+	applet.setAttribute("archive", cortadourl);
+	applet.setAttribute("width", width);
+
+	if (controls == "true") {
+		height=parseInt(height)+12;
+	}
+	applet.setAttribute("height", height);
+
+	var param = document.createElement("param");
+	param.setAttribute("name", "BufferSize");
+	param.setAttribute("value", "4096");
+	applet.appendChild(param);
+
+	param = document.createElement("param");
+	param.setAttribute("name", "BufferHigh");
+	param.setAttribute("value", "25");
+	applet.appendChild(param);
+
+	param = document.createElement("param");
+	param.setAttribute("name", "BufferLow");
+	param.setAttribute("value", "5");
+	applet.appendChild(param);
+
+	param = document.createElement("param");
+	param.setAttribute("name", "url");
+	param.setAttribute("value", src);
+	applet.appendChild(param);
+
+	param = document.createElement("param");
+	param.setAttribute("name", "autoPlay");
+	param.setAttribute("value", autoplay);
+	applet.appendChild(param);
+
+	if (controls == "true") {
+	    param = document.createElement("param");
+	    param.setAttribute("name", "showStatus");
+	    param.setAttribute("value", "show");
+	    applet.appendChild(param);
+	}
+
+	if (duration) {
+	    param = document.createElement("param");
+	    param.setAttribute("name", "duration");
+	    param.setAttribute("value", duration);
+	    applet.appendChild(param);
+	}
+	containerdiv.appendChild(applet);
+	parent.replaceChild(containerdiv, video);
+    } else if (oggPlugin=="true") {
+	var object = document.createElement("object");
+	object.setAttribute("width", width);
+	object.setAttribute("height", height);
+	object.setAttribute("data", src);
+	object.setAttribute("type", "video/ogg");
+	containerdiv.appendChild(object);
+	parent.replaceChild(containerdiv, video);
+    } else if (vlcActiveX=="true") {
+	var span = document.createElement("span");
+	span.innerHTML =
+	    "<object classid='clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921' codebase='http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab' width='"
+	    + width + "' height='" + height +
+	    "' id='vlc' events='True'><param name='Src' value='" + src +
+	    "'/> <param name='ShowDisplay' value='True'/><param name='AutoLoop' value='False'/><param name='AutoPlay' value='False'/></object>";
+	parent.replaceChild(span, video);
+	containerdiv.appendChild(span);
+	parent.replaceChild(containerdiv, video);
+    } else if (vlcPlugin=="true") {
+	var span = document.createElement("span");
+	span.innerHTML =
+	    "<object type='application/x-vlc-plugin' id='vlc_element' width='"
+	    + width + "' height='" + height + "' data='" + src +
+	    "'></object><br>" +
+	    "<input type='button' value='play' onClick='document.getElementById(\"vlc_element\").play()'>"
+	    +
+	    "<input type='button' value='stop' onClick='document.getElementById(\"vlc_element\").stop()'>";
+	containerdiv.appendChild(span);
+	parent.replaceChild(containerdiv, video);
+    } else {
+	var msg =
+	    document.createTextNode
+	    ("No fitting Ogg decoder found. Install a proper browser with Ogg Theora support or a browser plugin fit for Ogg Theora playback.");
+	parent.appendChild(msg);
+    }
+
+}



More information about the commits mailing list