1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<HTML>
<TITLE>VLC Mozilla plugin test page</TITLE>
<BODY>
<TABLE>
<TR><TD colspan="2">
MRL:
<INPUT size="90" id="targetTextField" value="">
<INPUT type=submit value="Go" onClick="doGo(document.getElementById('targetTextField').value);">
</TD></TR>
<TR><TD colspan="2">
<EMBED type="application/x-vlc-plugin" pluginspage="http://www.videolan.org/" version="VideoLAN.VLCPlugin.2"
width="640"
height="480"
id="vlc">
</EMBED>
</TD></TR>
</TD><TD width="15%">
<DIV id="info" style="text-align:center">-:--:--/-:--:--</DIV>
</TD></TR>
<TR><TD colspan="2">
<INPUT type=button id="PlayOrPause" value=" Play " onClick='doPlayOrPause()'>
<INPUT type=button value="Stop" onClick='document.getElementById("vlc").playlist.stop();'>
<INPUT type=button value=" << " onClick='document.getElementById("vlc").playlist.playSlower();'>
<INPUT type=button value=" >> " onClick='document.getElementById("vlc").playlist.playFaster();'>
<INPUT type=button value="Show" onClick='document.getElementById("vlc").visible = true;'>
<INPUT type=button value="Hide" onClick='document.getElementById("vlc").visible = false;'>
<INPUT type=button value="Version" onClick='alert(document.getElementById("vlc").VersionInfo);'>
<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.getElementById("vlc").audio.togglemute();'>
</TD>
</TR>
</TABLE>
<SCRIPT LANGUAGE="Javascript">
<!--
var timerId = 0;
function updateVolume(deltaVol)
{
var vlc = document.getElementById("vlc");
vlc.audio.volume += deltaVol;
volumeTextField.innerText = vlc.audio.volume+"%";
};
function formatTime(timeVal)
{
var timeHour = timeVal;
var timeSec = timeHour % 60;
if( timeSec < 10 )
timeSec = '0'+timeSec;
timeHour = (timeHour - timeSec)/60;
var timeMin = timeHour % 60;
if( timeMin < 10 )
timeMin = '0'+timeMin;
timeHour = (timeHour - timeMin)/60;
if( timeHour > 0 )
return timeHour+":"+timeMin+":"+timeSec;
else
return timeMin+":"+timeSec;
};
function onPlay()
{
document.getElementById("PlayOrPause").value = "Pause";
};
function onPause()
{
document.getElementById("PlayOrPause").value = " Play ";
};
function onStop()
{
info.innerText = "-:--:--/-:--:--";
document.getElementById("PlayOrPause").value = " Play ";
};
var liveFeedText = new Array("Live", "((Live))", "(( Live ))", "(( Live ))");
var liveFeedRoll = 0;
function doUpdate()
{
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("PlayOrPause").Enabled = true;
}
else {
liveFeedRoll = liveFeedRoll & 3;
info.innerText = liveFeedText[liveFeedRoll++];
}
timerId = setTimeout("doUpdate()", 1000);
}
else
{
onStop();
timerId = 0;
}
};
function doGo(targetURL)
{
var options = new Array(":vout-filter=deinterlace", ":deinterlace-mode=linear");
document.getElementById("vlc").playlist.add(targetURL, null, options);
};
function doPlayOrPause()
{
var vlc = document.getElementById("vlc");
if( vlc.playlist.isplaying )
{
vlc.playlist.pause();
}
else
{
vlc.playlist.play();
}
};
function vlcPlayEvent()
{
if( ! timerId )
{
timerId = setTimeout("doUpdate()", 1000);
}
onPlay();
};
function vlcPauseEvent()
{
if( timerId )
{
clearTimeout(timerId)
timerId = 0;
}
onPause();
};
function vlcStopEvent()
{
if( timerId )
{
clearTimeout(timerId)
timerId = 0;
}
onStop();
};
//-->
</SCRIPT>
</BODY>
</HTML>