basic functionality, no estetics: videos are listed in index; can be watched with...
[living-lab-site.git] / javascript / NextShare_VLC_plugin.js
similarity index 85%
rename from javascript/NextSharePC-interface.js
rename to javascript/NextShare_VLC_plugin.js
index 9db050b..dffb2cd 100644 (file)
@@ -1,4 +1,4 @@
-// NextSharePC plugin controls\r
+// NextSharePC plugin controls\r
 // Author: Calin-Andrei Burloiu, calin.burloiu@gmail.com\r
 // 2011\r
 \r
@@ -16,6 +16,17 @@ function getURLParam( name )
                return results[1];\r
 }\r
 \r
+function pad(number, length) \r
+{\r
+       var str = '' + number;\r
+       while (str.length < length) \r
+       {\r
+               str = '0' + str;\r
+       }\r
+\r
+       return str;\r
+}\r
+\r
 function getPluginWidth()\r
 {\r
        return 800;\r
@@ -68,19 +79,11 @@ function update()
        timerHandle = setTimeout("update()", updateInterval);\r
 }\r
 \r
-function displayNextSharePC(torrent, html5)\r
+function displayNextSharePC(torrent)\r
 {\r
-       if(html5 == true)\r
-       {\r
-               document.write('<video src="'+torrent+'" controls="controls" width="800" height="600">');\r
-               document.write('    Error: Your browser does not support HTML5!');\r
-               document.write('</video>');\r
-               document.write('<br /><br /><p><a href="' + window.location.href.replace('&html5=1', '') + '">');\r
-               document.write('Play video using VLC with NextSharePC</a></p>');\r
-\r
-               return true;\r
-       }\r
-\r
+       //document.write('popârțac');\r
+       //return;\r
+       \r
        if (navigator.appName == "Netscape")\r
        {\r
                document.write('<embed type="application/x-ns-stream"');\r
@@ -123,11 +126,6 @@ function displayNextSharePC(torrent, html5)
                + '<td><input type=button value="Fullscreen" onclick="fullscreen();" /></td></tr>'\r
                + '<tr><td colspan="4"><div id="nsSlider"></div></td></tr>'\r
                + '</table>');\r
-               \r
-       $("nsTable").css("width", getPluginWidth());\r
-\r
-       document.write('<br /><p><a href="' + window.location.href + '&html5=1">');\r
-       document.write('Play video using HTML5 with SwarmPlayer</a></p>');\r
 \r
        return true;\r
 }\r
@@ -155,17 +153,6 @@ function onSliderStop(event, ui)
        timerHandle = setTimeout("update()", updateInterval);\r
 }\r
 \r
-function pad(number, length) \r
-{\r
-       var str = '' + number;\r
-       while (str.length < length) \r
-       {\r
-               str = '0' + str;\r
-       }\r
-\r
-       return str;\r
-}\r
-\r
 function onSliderSlide(event, ui)\r
 {\r
        updateTime(true);\r
@@ -180,11 +167,13 @@ function onVolChange(event, ui)
        document.vlc.audio.volume = val;\r
 }\r
 \r
-$(document).ready(function() \r
+function loadControls()\r
 {\r
        if(document.vlc == null)\r
                return;\r
        \r
+       $("nsTable").css("width", getPluginWidth());\r
+       \r
        // Progress Slider\r
        $("#nsSlider").slider({ animate: true });\r
        $("#nsSlider").slider({ min: 0 });\r
@@ -208,7 +197,7 @@ $(document).ready(function()
        $("#nsVol").slider();\r
        \r
        timerHandle = setTimeout("update()", updateInterval);\r
-});  \r
+}\r
 \r
 function play()\r
 {\r