2 <TITLE>VLC ActiveX plugin test page</TITLE>
7 <INPUT size="90" name="targetTextField" value="">
8 <INPUT type=submit value="Go" onClick="doGo(targetTextField.value);">
12 Insert VideoLAN.VLCPlugin.1 activex control
14 <OBJECT classid="clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8" codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab#Version=0,8,4,0"
15 width="640" height="480" id="vlc" events="True">
16 <param name="MRL" value="" />
17 <param name="ShowDisplay" value="True" />
18 <param name="AutoLoop" value="False" />
19 <param name="AutoPlay" value="False" />
24 Insert MSComctlLib.Slider.2 activex control
26 <OBJECT classid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628"
27 width="540" height="20" id="slider" events="True">
28 <param name="TickStyle" value="3" />
29 <param name="Min" value="0" />
30 <param name="Max" value="0" />
31 <param name="Value" value="0" />
32 <param name="Enabled" value="False" />
35 <DIV id="info" style="text-align:center">-:--:--/-:--:--</DIV>
38 <INPUT type=button id="PlayOrPause" value=" Play " onClick='doPlayOrPause()'>
39 <INPUT type=button value="Stop" onClick='document.vlc.stop();'>
40 <INPUT type=button value=" << " onClick='document.vlc.playSlower();'>
41 <INPUT type=button value=" >> " onClick='document.vlc.playFaster();'>
42 <INPUT type=button value="Mute" onClick='document.vlc.toggleMute();'>
43 <INPUT type=button value="Show" onClick='document.vlc.Visible = true;'>
44 <INPUT type=button value="Hide" onClick='document.vlc.Visible = false;'>
45 <INPUT type=button value="Version" onClick='alert(document.vlc.VersionInfo);'>
48 <SCRIPT LANGUAGE="JScript">
50 var sliderTimerId = 0;
51 var sliderScrolling = false;
53 function formatTime(timeVal)
55 var timeHour = timeVal;
56 var timeSec = timeHour % 60;
58 timeSec = '0'+timeSec;
59 timeHour = (timeHour - timeSec)/60;
60 var timeMin = timeHour % 60;
62 timeMin = '0'+timeMin;
63 timeHour = (timeHour - timeMin)/60;
65 return timeHour+":"+timeMin+":"+timeSec;
67 return timeMin+":"+timeSec;
71 document.getElementById("PlayOrPause").value = "Pause";
75 document.getElementById("PlayOrPause").value = " Play ";
81 slider.Value = slider.Min;
82 slider.Enabled = false;
84 info.innerText = "-:--:--/-:--:--";
85 document.getElementById("PlayOrPause").value = " Play ";
87 var liveFeedText = new Array("Live", "((Live))", "(( Live ))", "(( Live ))");
94 if( ! sliderScrolling )
99 slider.Enabled = true;
100 slider.Max = vlc.Length;
101 slider.Value = vlc.Time;
102 info.innerText = formatTime(vlc.Time)+"/"+formatTime(vlc.Length);
103 document.getElementById("PlayOrPause").Enabled = true;
106 // non-seekable "live" stream
109 slider.Value = slider.Min;
110 slider.Enabled = false;
112 liveFeedRoll = liveFeedRoll & 3;
113 info.innerText = liveFeedText[liveFeedRoll++];
116 sliderTimerId = setTimeout("doUpdate()", 1000);
124 function doGo(targetURL)
126 var options = new Array(":vout-filter=deinterlace", ":deinterlace-mode=linear");
127 document.vlc.addTarget(targetURL, options, 4+8, -666);
129 function doPlayOrPause()
131 if( document.vlc.playing )
133 document.vlc.pause();
142 if( ! sliderTimerId )
144 sliderTimerId = setTimeout("doUpdate()", 1000);
148 function vlc::Pause()
152 clearTimeout(sliderTimerId)
161 clearTimeout(sliderTimerId)
166 function slider::Scroll()
168 slider.Text = formatTime(slider.Value);
169 info.innerText = slider.Text+"/"+formatTime(vlc.Length);
170 if( vlc.Time != slider.Value )
172 vlc.Time = slider.Value;
175 function slider::Change()
177 if( sliderScrolling )
179 sliderScrolling = false;
181 else if( vlc.Time != slider.Value )
183 vlc.Time = slider.Value;