stream_out: fix warnings
[vlc.git] / mozilla / test.html
blob4f61cdc9c8c5aa638f15d788996816e9d818797c
1 <HTML>
2 <TITLE>VLC Mozilla plugin test page</TITLE>
3 <BODY>
4 <TABLE>
5 <TR><TD colspan="2">
6 MRL:
7 <INPUT size="90" id="targetTextField" value="">
8 <INPUT type=submit value="Go" onClick="doGo(document.getElementById('targetTextField').value);">
9 </TD></TR>
10 <TR><TD colspan="2">
11 <EMBED type="application/x-vlc-plugin" pluginspage="http://www.videolan.org/" version="VideoLAN.VLCPlugin.2"
12 width="640"
13 height="480"
14 id="vlc">
15 </EMBED>
16 </TD></TR>
17 <TR><TD>
18 <INPUT type=button id="PlayOrPause" value=" Play " onClick='doPlayOrPause()'>
19 <INPUT type=button value="Stop" onClick='document.getElementById("vlc").playlist.stop();'>
20 &nbsp;
21 <INPUT type=button value=" << " onClick='doPlaySlower();'>
22 <INPUT type=button value=" >> " onClick='doPlayFaster();'>
23 &nbsp;
24 <INPUT type=button value="Version" onClick='alert(document.getElementById("vlc"));'>
25 <SPAN style="text-align:center">Volume:</SPAN>
26 <INPUT type=button value=" - " onClick='updateVolume(-10)'>
27 <SPAN id="volumeTextField" style="text-align: center">--</SPAN>
28 <INPUT type=button value=" + " onClick='updateVolume(+10)'>
29 <INPUT type=button value="Mute" onClick='document.getElementById("vlc").audio.toggleMute();'>
30 </TD><TD width="15%">
31 <DIV id="info" style="text-align:center">-:--:--/-:--:--</DIV>
32 </TD></TR>
33 </TABLE>
34 <SCRIPT LANGUAGE="Javascript">
35 <!--
36 var timerId = 0;
38 function updateVolume(deltaVol)
40 var vlc = document.getElementById("vlc");
41 vlc.audio.volume += deltaVol;
42 document.getElementById("volumeTextField").innerHTML = vlc.audio.volume+"%";
44 function formatTime(timeVal)
46 var timeHour = timeVal;
47 var timeSec = timeHour % 60;
48 if( timeSec < 10 )
49 timeSec = '0'+timeSec;
50 timeHour = (timeHour - timeSec)/60;
51 var timeMin = timeHour % 60;
52 if( timeMin < 10 )
53 timeMin = '0'+timeMin;
54 timeHour = (timeHour - timeMin)/60;
55 if( timeHour > 0 )
56 return timeHour+":"+timeMin+":"+timeSec;
57 else
58 return timeMin+":"+timeSec;
60 function onPlay()
62 document.getElementById("PlayOrPause").value = "Pause";
64 function onPause()
66 document.getElementById("PlayOrPause").value = " Play ";
68 function onStop()
70 document.getElementById("info").innerHTML = "-:--:--/-:--:--";
71 document.getElementById("PlayOrPause").value = " Play ";
73 var liveFeedText = new Array("Live", "((Live))", "(( Live ))", "(( Live ))");
74 var liveFeedRoll = 0;
76 function doUpdate()
78 var vlc = document.getElementById("vlc");
79 if( vlc.playlist.isPlaying )
81 if( vlc.input.length > 0 )
83 // seekable stream
84 document.getElementById("info").innerHTML = formatTime(vlc.input.time/1000)+"/"+formatTime(vlc.input.length/1000);
85 document.getElementById("PlayOrPause").Enabled = true;
87 else {
88 liveFeedRoll = liveFeedRoll & 3;
89 document.getElementById("info").innerText = liveFeedText[liveFeedRoll++];
91 timerId = setTimeout("doUpdate()", 1000);
93 else
95 onStop();
96 timerId = 0;
99 function doGo(targetURL)
101 var options = new Array(":vout-filter=deinterlace", ":deinterlace-mode=linear");
102 document.getElementById("vlc").playlist.add(targetURL, null, options);
104 function doPlayOrPause()
106 var vlc = document.getElementById("vlc");
107 if( vlc.playlist.isPlaying )
109 vlc.playlist.pause();
111 else
113 vlc.playlist.play();
116 function doPlaySlower()
118 var vlc = document.getElementById("vlc");
119 vlc.input.rate = vlc.input.rate / 2;
121 function doPlayFaster()
123 var vlc = document.getElementById("vlc");
124 vlc.input.rate = vlc.input.rate * 2;
126 function vlcPlayEvent()
128 if( ! timerId )
130 timerId = setTimeout("doUpdate()", 1000);
132 onPlay();
134 function vlcPauseEvent()
136 if( timerId )
138 clearTimeout(timerId)
139 timerId = 0;
141 onPause();
143 function vlcStopEvent()
145 if( timerId )
147 clearTimeout(timerId)
148 timerId = 0;
150 onStop();
152 //-->
153 </SCRIPT>
154 </BODY>
155 </HTML>