]> git.sesse.net Git - vlc/blobdiff - mozilla/test.html
stream_out: fix warnings
[vlc] / mozilla / test.html
index 40cf18cad38d7ec300492aaec92463d36d2eaad5..4f61cdc9c8c5aa638f15d788996816e9d818797c 100644 (file)
@@ -14,27 +14,22 @@ MRL:
         id="vlc">
 </EMBED>
 </TD></TR>
-</TD><TD width="15%">
-<DIV id="info" style="text-align:center">-:--:--/-:--:--</DIV>
-</TD></TR>
-<TR><TD colspan="2">
+<TR><TD>
 <INPUT type=button id="PlayOrPause" value=" Play " onClick='doPlayOrPause()'>
-<INPUT type=button value="Stop" onClick='document.vlc.playlist.stop();'>
-&nbsp;
-<INPUT type=button value=" << " onClick='document.vlc.playlist.playSlower();'>
-<INPUT type=button value=" >> " onClick='document.vlc.playlist.playFaster();'>
+<INPUT type=button value="Stop" onClick='document.getElementById("vlc").playlist.stop();'>
 &nbsp;
-<INPUT type=button value="Show" onClick='document.vlc.visible = true;'>
-<INPUT type=button value="Hide" onClick='document.vlc.visible = false;'>
+<INPUT type=button value=" << " onClick='doPlaySlower();'>
+<INPUT type=button value=" >> " onClick='doPlayFaster();'>
 &nbsp;
-<INPUT type=button value="Version" onClick='alert(document.vlc.VersionInfo);'>
+<INPUT type=button value="Version" onClick='alert(document.getElementById("vlc"));'>
 <SPAN style="text-align:center">Volume:</SPAN>
 <INPUT type=button value=" - " onClick='updateVolume(-10)'>
 <SPAN id="volumeTextField" style="text-align: center">--</SPAN>
 <INPUT type=button value=" + " onClick='updateVolume(+10)'>
-<INPUT type=button value="Mute" onClick='document.vlc.audio.togglemute();'>
-</TD>
-</TR>
+<INPUT type=button value="Mute" onClick='document.getElementById("vlc").audio.toggleMute();'>
+</TD><TD width="15%">
+<DIV id="info" style="text-align:center">-:--:--/-:--:--</DIV>
+</TD></TR>
 </TABLE>
 <SCRIPT LANGUAGE="Javascript">
 <!--
@@ -42,9 +37,9 @@ var timerId = 0;
 
 function updateVolume(deltaVol)
 {
-    var plugin = document.getElementById('vlc');
-    plugin.audio.volume += deltaVol;
-    volumeTextField.innerText = plugin.audio.volume+"%";
+    var vlc = document.getElementById("vlc");
+    vlc.audio.volume += deltaVol;
+    document.getElementById("volumeTextField").innerHTML = vlc.audio.volume+"%";
 };
 function formatTime(timeVal)
 {
@@ -72,7 +67,7 @@ function onPause()
 };
 function onStop()
 {
-    info.innerText = "-:--:--/-:--:--";
+    document.getElementById("info").innerHTML = "-:--:--/-:--:--";
     document.getElementById("PlayOrPause").value = " Play ";
 };
 var liveFeedText = new Array("Live", "((Live))", "(( Live ))", "((  Live  ))");
@@ -80,17 +75,18 @@ var liveFeedRoll = 0;
 
 function doUpdate()
 {
-    if( vlc.playlist.isplaying )
+    var vlc = document.getElementById("vlc");
+    if( vlc.playlist.isPlaying )
     {
         if( vlc.input.length > 0 )
         {
             // seekable stream
-            info.innerText = formatTime(vlc.input.time/1000)+"/"+formatTime(vlc.input.length/1000);
+            document.getElementById("info").innerHTML = formatTime(vlc.input.time/1000)+"/"+formatTime(vlc.input.length/1000);
             document.getElementById("PlayOrPause").Enabled = true;
         }
         else {
             liveFeedRoll = liveFeedRoll & 3;
-            info.innerText = liveFeedText[liveFeedRoll++];
+            document.getElementById("info").innerText = liveFeedText[liveFeedRoll++];
         }
         timerId = setTimeout("doUpdate()", 1000);
     }
@@ -103,19 +99,30 @@ function doUpdate()
 function doGo(targetURL)
 {
        var options = new Array(":vout-filter=deinterlace", ":deinterlace-mode=linear");
-       document.vlc.playlist.add(targetURL, null, options);
+       document.getElementById("vlc").playlist.add(targetURL, null, options);
 };
 function doPlayOrPause()
 {
-    if( document.vlc.playlist.isplaying )
+    var vlc = document.getElementById("vlc");
+    if( vlc.playlist.isPlaying )
     {
-        document.vlc.playlist.pause();
+        vlc.playlist.pause();
     }
     else
     {
-        document.vlc.playlist.play();
+        vlc.playlist.play();
     }
 };
+function doPlaySlower()
+{
+    var vlc = document.getElementById("vlc");
+    vlc.input.rate = vlc.input.rate / 2;
+};
+function doPlayFaster()
+{
+    var vlc = document.getElementById("vlc");
+    vlc.input.rate = vlc.input.rate * 2;
+};
 function vlcPlayEvent()
 {
     if( ! timerId )