Commit ae00feec authored by Jean-Paul Saman's avatar Jean-Paul Saman

Update mozilla test page.

parent 227de1f7
<HTML> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<TITLE>VLC Mozilla plug-in test page</TITLE> <HTML>
<BODY> <TITLE>VLC Plugin test page</TITLE>
<TABLE> <STYLE>
<TR><TD colspan="2"> .inputTrackerInput {
MRL: height:20;
<INPUT size="90" id="targetTextField" value=""> width:30;
<INPUT type=submit value="Go" onClick="doGo(document.getElementById('targetTextField').value);"> font-family : Arial, Helvetica, sans-serif;
</TD></TR> font-size : 12px;
<TR><TD colspan="2"> }
<EMBED type="application/x-vlc-plugin" pluginspage="http://www.videolan.org/" version="VideoLAN.VLCPlugin.2" </STYLE>
width="640"
height="480" <SCRIPT type="text/javascript" src="blueshoes-4.5/javascript/lib/LibCrossBrowser.js"></SCRIPT>
id="vlc"> <SCRIPT type="text/javascript" src="blueshoes-4.5/javascript/lib/EventHandler.js"></SCRIPT>
</EMBED> <SCRIPT type="text/javascript" src="blueshoes-4.5/javascript/core/form/Bs_FormUtil.lib.js"></SCRIPT>
</TD></TR> <SCRIPT type="text/javascript" src="blueshoes-4.5/javascript/components/slider/Bs_Slider.class.js"></SCRIPT>
<TR><TD>
<INPUT type=button id="PlayOrPause" value=" Play " onClick='doPlayOrPause()'> <SCRIPT language="JavaScript"><!--
<INPUT type=button value="Stop" onClick='document.getElementById("vlc").playlist.stop();'> function init(){
&nbsp; inputTracker = new Bs_Slider();
<INPUT type=button value=" << " onClick='doPlaySlower();'> inputTracker.attachOnChange(onInputTrackerChange);
<INPUT type=button value=" >> " onClick='doPlayFaster();'> inputTracker.attachOnSlideStart(onInputTrackerScrollStart);
&nbsp; inputTracker.attachOnSlideEnd(onInputTrackerScrollEnd);
<INPUT type=button value="Version" onClick='alert(document.getElementById("vlc"));'> inputTracker.width = 530 ;
<SPAN style="text-align:center">Volume:</SPAN> inputTracker.height = 15;
<INPUT type=button value=" - " onClick='updateVolume(-10)'> inputTracker.minVal = 0;
<SPAN id="volumeTextField" style="text-align: center">--</SPAN> inputTracker.maxVal = 1.0;
<INPUT type=button value=" + " onClick='updateVolume(+10)'> inputTracker.valueDefault = 0;
<INPUT type=button value="Mute" onClick='document.getElementById("vlc").audio.toggleMute();'> inputTracker.valueInterval = 1/530;
</TD><TD width="15%"> inputTracker.setDisabled(true);
<DIV id="info" style="text-align:center">-:--:--/-:--:--</DIV> inputTracker.imgDir = 'blueshoes-4.5/javascript/components/slider/img/';
</TD></TR> inputTracker.setBackgroundImage('aluminumalloyvolcanic/horizontal_background.gif', 'repeat');
</TABLE> inputTracker.setArrowIconLeft('aluminumalloyvolcanic/horizontal_backgroundLeft.gif', 2, 19);
<SCRIPT LANGUAGE="Javascript"> inputTracker.setArrowIconRight('aluminumalloyvolcanic/horizontal_backgroundRight.gif', 2, 19);
<!-- inputTracker.setSliderIcon('aluminumalloyvolcanic/horizontal_knob.gif', 15, 19);
var timerId = 0; inputTracker.useInputField = 0;
inputTracker.draw('inputTrackerDiv');
function updateVolume(deltaVol)
{ if( navigator.appName.indexOf("Microsoft Internet")==-1 )
var vlc = document.getElementById("vlc"); {
vlc.audio.volume += deltaVol; onVLCPluginReady()
document.getElementById("volumeTextField").innerHTML = vlc.audio.volume+"%"; }
}; else if( document.readyState == 'complete' )
function formatTime(timeVal) {
{ onVLCPluginReady();
var timeHour = timeVal; }
var timeSec = timeHour % 60; else
if( timeSec < 10 ) {
timeSec = '0'+timeSec; /* Explorer loads plugins asynchronously */
timeHour = (timeHour - timeSec)/60; document.onreadystatechange=function() {
var timeMin = timeHour % 60; if( document.readyState == 'complete' )
if( timeMin < 10 ) {
timeMin = '0'+timeMin; onVLCPluginReady();
timeHour = (timeHour - timeMin)/60; }
if( timeHour > 0 ) }
return timeHour+":"+timeMin+":"+timeSec; }
else };
return timeMin+":"+timeSec;
}; function getVLC(name)
function onPlay() {
{ if (window.document[name])
document.getElementById("PlayOrPause").value = "Pause"; {
}; return window.document[name];
function onPause() }
{ if (navigator.appName.indexOf("Microsoft Internet")==-1)
document.getElementById("PlayOrPause").value = " Play "; {
}; if (document.embeds && document.embeds[name])
function onStop() return document.embeds[name];
{ }
document.getElementById("info").innerHTML = "-:--:--/-:--:--"; else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
document.getElementById("PlayOrPause").value = " Play "; {
}; return document.getElementById(name);
var liveFeedText = new Array("Live", "((Live))", "(( Live ))", "(( Live ))"); }
var liveFeedRoll = 0; };
function doUpdate() function onVLCPluginReady()
{ {
var vlc = document.getElementById("vlc"); updateVolume(0);
if( vlc.playlist.isPlaying ) };
{
if( vlc.input.length > 0 ) //--></SCRIPT>
{
// seekable stream <BODY onLoad="init();">
document.getElementById("info").innerHTML = formatTime(vlc.input.time/1000)+"/"+formatTime(vlc.input.length/1000); <TABLE>
document.getElementById("PlayOrPause").Enabled = true; <TR><TD colspan="2">
} MRL:
else { <INPUT size="90" id="targetTextField" value="">
liveFeedRoll = liveFeedRoll & 3; <INPUT type=submit value="Go" onClick="doGo(document.getElementById('targetTextField').value);">
document.getElementById("info").innerText = liveFeedText[liveFeedRoll++]; <INPUT type=submit value="Add" onClick="doAdd(document.getElementById('targetTextField').value);">
} </TD></TR>
timerId = setTimeout("doUpdate()", 1000); <TR><TD align="center" colspan="2">
} <!--
else Insert VideoLAN.VLCPlugin.2
{ -->
onStop(); <OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
timerId = 0; width="640"
} height="480"
}; id="vlc"
function doGo(targetURL) events="True">
{ <param name="MRL" value="" />
var options = new Array(":vout-filter=deinterlace", ":deinterlace-mode=linear"); <param name="ShowDisplay" value="True" />
document.getElementById("vlc").playlist.add(targetURL, null, options); <param name="AutoLoop" value="False" />
}; <param name="AutoPlay" value="False" />
function doPlayOrPause() <param name="Volume" value="50" />
{ <param name="toolbar" value="true" />
var vlc = document.getElementById("vlc"); <param name="StartTime" value="0" />
if( vlc.playlist.isPlaying ) <EMBED pluginspage="http://www.videolan.org"
{ type="application/x-vlc-plugin"
vlc.playlist.pause(); version="VideoLAN.VLCPlugin.2"
} width="640"
else height="480"
{ toolbar="true"
vlc.playlist.play(); name="vlc">
} </EMBED>
}; </OBJECT>
function doPlaySlower() </TD></TR>
{ <TR><TD colspan="2">
var vlc = document.getElementById("vlc"); <TABLE><TR>
vlc.input.rate = vlc.input.rate / 2; <TD valign="top" width="550">
}; <!--
function doPlayFaster() Insert Slider widget
{ -->
var vlc = document.getElementById("vlc"); <DIV id="inputTrackerDiv"</DIV>
vlc.input.rate = vlc.input.rate * 2; </TD><TD width="15%">
}; <DIV id="info" style="text-align:center">-:--:--/-:--:--</DIV>
function vlcPlayEvent() <DIV id="state" style="text-align:center">Stopped...</DIV>
{ </TD></TR></TABLE>
if( ! timerId ) </TD></TR>
{ <TR><TD>
timerId = setTimeout("doUpdate()", 1000); <INPUT type=button id="PlayOrPause" value=" Play " onClick='doPlayOrPause();'>
} <INPUT type=button value="Stop" onClick='doStop();'>
onPlay(); &nbsp;
}; <INPUT type=button value=" << " onClick='doPlaySlower();'>
function vlcPauseEvent() <INPUT type=button value=" >> " onClick='doPlayFaster();'>
{ <INPUT type=button value="Backward" onClick='doBackwardPlay(500);'>
if( timerId ) <INPUT type=button value="Forward" onClick='doForwardPlay(500);'>
{ <INPUT type=button value="Fullscreen" onClick='getVLC("vlc").video.toggleFullscreen();'>
clearTimeout(timerId) <INPUT type=button value="Version" onClick='alert("vlc " + getVLC("vlc").VersionInfo);'>
timerId = 0; <INPUT type=button value=" State " onClick='doState();'>
} </TD><TD align="right">
onPause(); <SPAN style="text-align:center">Volume:</SPAN>
}; <INPUT type=button value=" - " onClick='updateVolume(-10)'>
function vlcStopEvent() <SPAN id="volumeTextField" style="text-align:center">--</SPAN>
{ <INPUT type=button value=" + " onClick='updateVolume(+10)'>
if( timerId ) <INPUT type=button value="Mute" onClick='getVLC("vlc").audio.toggleMute();'>
{ </TD>
clearTimeout(timerId) </TR>
timerId = 0; <TR><TD>Playlist:
} <INPUT type=button value="Prev" onClick='getVLC("vlc").playlist.prev();'>
onStop(); <INPUT type=button value="Next" onClick='getVLC("vlc").playlist.next();'>
}; <INPUT type=button value="Clear All" onClick='getVLC("vlc").playlist.clear(); doItemCount();'>
//--> <INPUT size=4 value="1:1" id="aspect"><INPUT type=submit value="AspectRatio" onClick="doAspectRatio(document.getElementById('aspect').value);">
</SCRIPT> </TD><TD align="right">
</BODY> <INPUT type=button id="itemCount" value=" Items 0 " onClick='doItemCount();'>
</HTML> <INPUT size=4 value="" id="removeid"><INPUT type=submit value="Delete" onClick="doRemoveItem(document.getElementById('removeid').value);">
</TD>
</TR>
<TR><TD>Messages:
<INPUT type=button value="Messages" onClick='doMessages();'>
Verbosity:
<INPUT size=2 value="1" id="verbosity" onClick="doVerbosity(document.getElementById('verbosity').value);">
<INPUT type=button value=" + " onClick='doVerbosity(1);'>
<INPUT type=button value=" - " onClick='doVerbosity(-1);'>
</TD>
<TD>
<DIV id="message" style="text-align:center">no message</DIV>
</TD>
</TR>
<TR><TD>Audio Channel:
<SELECT readonly onClick='doAudioChannel(this.value);'>
<OPTION value=1>Stereo</OPTION>
<OPTION value=2>Reverse Stereo</OPTION>
<OPTION value=3>Left</OPTION>
<OPTION value=4>Right</OPTION>
<OPTION value=5>Dolby</OPTION>
</SELECT>
</TD>
<TD>
<INPUT type=button value="current channel" onClick='alert(getVLC("vlc").audio.channel);'>
</TD>
</TR>
<TR><TD> Audio Track:
<INPUT type=button value=" + " onClick='doAudioTrack(1);'>
<SPAN id="trackTextField" style="text-align:center">--</SPAN>
<INPUT type=button value=" - " onClick='doAudioTrack(-1);'>
</TD>
<TD>
<INPUT type=button value="set slider" onClick='doSetSlider();'>
<INPUT type=button value="get position" onClick='doGetPosition();'>
</TD>
</TR>
</TABLE>
<SCRIPT language="javascript">
<!--
var rate = 0;
var prevState = 0;
var monitorTimerId = 0;
var rateTimerId = 0;
var inputTrackerScrolling = false;
var inputTrackerIgnoreChange = false;
function doSetSlider()
{
var vlc = getVLC("vlc");
if (vlc.input)
{
// set slider to new position
vlc.input.time = (vlc.input.length/2);
}
};
function doGetPosition()
{
var vlc = getVLC("vlc");
if (vlc.input)
{
// set slider to new position
alert( "position is " + vlc.input.time);
}
};
function doForwardPlay(speed)
{
if (rateTimerId == 0)
{
rateTimerId = setInterval("ratechange()", speed);
rate = speed;
}
else rate = rate + speed;
};
function doBackwardPlay(speed)
{
if (rateTimerId == 0)
{
rateTimerId = setInterval("ratechange()", speed);
rate = -speed;
}
else rate = rate - speed;
};
function ratechange()
{
if (rateTimerId != 0)
{
var vlc = getVLC("vlc");
vlc.input.time = vlc.input.time + rate;
}
};
function doVerbosity(value)
{
var vlc = getVLC("vlc");
vlc.log.verbosity = vlc.log.verbosity + value;
document.getElementById("verbosity").value = vlc.log.verbosity;
};
function doAudioChannel(value)
{
var vlc = getVLC("vlc");
vlc.audio.channel = parseInt(value);
};
function doAudioTrack(value)
{
var vlc = getVLC("vlc");
vlc.audio.track = vlc.audio.track + value;
document.getElementById("trackTextField").innerHTML = vlc.audio.track;
};
function doAspectRatio(value)
{
var vlc = getVLC("vlc");
vlc.video.aspectRatio = value;
document.getElementById("aspect").value = vlc.video.aspectRatio;
}
function doItemCount()
{
var vlc = getVLC("vlc");
var count = vlc.playlist.itemCount;
document.getElementById("itemCount").value = " Items " + count + " ";
};
function doRemoveItem(item)
{
var vlc = getVLC("vlc");
vlc.playlist.removeItem(item);
};
function doMessages()
{
var vlc = getVLC("vlc");
if( vlc.log.messages.count > 0 )
{
// there is one or more messages in the log
var iter = vlc.log.messages.iterator();
while( iter.hasNext )
{
var msg = iter.next();
if( msg.severity <= 1 )
{
document.getElementById("message").innerHTML = msg.message;
}
}
// clear the log once finished to avoid clogging
vlc.log.messages.clear();
}
};
function updateVolume(deltaVol)
{
var vlc = getVLC("vlc");
vlc.audio.volume += deltaVol;
document.getElementById("volumeTextField").innerHTML = vlc.audio.volume+"%";
};
function formatTime(timeVal)
{
var timeHour = Math.round(timeVal / 1000);
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 doState()
{
var vlc = getVLC("vlc");
var newState = vlc.input.state;
if( newState == 0 )
{
// current media has stopped
onEnd();
}
else if( newState == 1 )
{
// current media is openning/connecting
onOpen();
}
else if( newState == 2 )
{
// current media is buffering data
onBuffer();
}
else if( newState == 3 )
{
// current media is now playing
onPlay();
}
else if( newState == 4 )
{
// current media is now paused
onPause();
}
else if( newState == 5 )
{
// current media has stopped
onStop();
}
else if( newState == 6 )
{
// current media is playing forward
onForward();
}
else if( newState == 7 )
{
// current media is playing backward
onBackward();
}
else if( newState == 8 )
{
// current media has ended
onEnd();
}
else if( newState == 9 )
{
// current media encountered error
onError();
}
};
function monitor()
{
var vlc = getVLC("vlc");
var newState = vlc.input.state;
if( vlc.log.messages.count > 0 )
{
// there is one or more messages in the log
var iter = vlc.log.messages.iterator();
while( iter.hasNext )
{
var msg = iter.next();
if( msg.severity == 1 )
{
alert( msg.message );
}
document.getElementById("message").innerHTML = msg.message;
}
// clear the log once finished to avoid clogging
vlc.log.messages.clear();
}
if( prevState != newState )
{
if( newState == 0 )
{
// current media has stopped
onEnd();
}
else if( newState == 1 )
{
// current media is openning/connecting
onOpen();
}
else if( newState == 2 )
{
// current media is buffering data
onBuffer();
}
else if( newState == 3 )
{
// current media is now playing
onPlay();
}
else if( newState == 4 )
{
// current media is now paused
onPause();
}
else if( newState == 5 )
{
// current media has stopped
onStop();
}
else if( newState == 6 )
{
// current media is playing forward
onForward();
}
else if( newState == 7 )
{
// current media is playing backward
onBackward();
}
else if( newState == 8 )
{
// current media has ended
onEnd();
}
else if( newState == 9 )
{
// current media encountered error
onError();
}
prevState = newState;
}
else if( newState == 3 )
{
// current media is playing
onPlaying();
}
if( monitorTimerId == 0 )
{
monitorTimerId = setInterval("monitor()", 1000);
}
};
/* actions */
function doGo(targetURL)
{
var vlc = getVLC("vlc");
vlc.playlist.clear();
while( vlc.playlist.itemCount > 0 )
{
// clear() may return before the playlist has actually been cleared
// just wait for it to finish its job
}
//vlc.playlist.add(targetURL);
//vlc.playlist.play();
var itemId = vlc.playlist.add(targetURL);
if( itemId != -1 )
{
// clear the message log and enable error logging
vlc.log.verbosity = 1;
vlc.log.messages.clear();
// play MRL
vlc.playlist.play();
if( monitorTimerId == 0 )
{
monitor();
}
}
else
{
// disable log
vlc.log.verbosity = -1;
alert("cannot play at the moment !");
}
doItemCount();
if (rateTimerId != 0)
{
clearInterval("ratechange()");
}
rateTimerId = 0;
};
function doAdd(targetURL)
{
var vlc = getVLC("vlc");
var options = new Array(":vout-filter=deinterlace", ":deinterlace-mode=linear");
vlc.playlist.add(targetURL);
doItemCount();
};
function doPlayOrPause()
{
var vlc = getVLC("vlc");
if( vlc.playlist.isPlaying )
{
vlc.playlist.togglePause();
monitor();
}
else if( vlc.playlist.itemCount > 0 )
{
// clear the message log and enable error logging
vlc.log.verbosity = 1;
vlc.log.messages.clear();
vlc.playlist.play();
monitor();
}
else
{
// disable log
vlc.log.verbosity = -1;
alert('nothing to play !');
}
if (rateTimerId != 0)
{
clearInterval("ratechange()");
}
rateTimerId = 0;
};
function doStop()
{
getVLC("vlc").playlist.stop();
if( monitorTimerId != 0 )
{
clearInterval(monitorTimerId);
monitorTimerId = 0;
}
onStop();
};
function doPlaySlower()
{
var vlc = getVLC("vlc");
vlc.input.rate = vlc.input.rate / 2;
};
function doPlayFaster()
{
var vlc = getVLC("vlc");
vlc.input.rate = vlc.input.rate * 2;
};
/* events */
function onOpen()
{
document.getElementById("state").innerHTML = "Opening...";
document.getElementById("PlayOrPause").value = "Pause";
};
function onBuffer()
{
document.getElementById("state").innerHTML = "Buffering...";
document.getElementById("PlayOrPause").value = "Pause";
};
function onPlay()
{
document.getElementById("state").innerHTML = "Playing...";
document.getElementById("PlayOrPause").value = "Pause";
onPlaying();
};
function onForward()
{ // Event is reserved for future enhancements
document.getElementById("state").innerHTML = "Forward playing...";
};
function onBackward()
{ // Event is reserved for future enhancements
document.getElementById("state").innerHTML = "Backward playing...";
};
function onEnd()
{
document.getElementById("state").innerHTML = "End...";
};
var liveFeedText = new Array("Live", "((Live))", "(( Live ))", "(( Live ))");
var liveFeedRoll = 0;
function onPlaying()
{
if( ! inputTrackerScrolling )
{
var vlc = getVLC("vlc");
var info = document.getElementById("info");
var mediaLen = vlc.input.length;
inputTrackerIgnoreChange = true;
if( mediaLen > 0 )
{
// seekable media
if( inputTracker.maxVal == 1.0 )
{
inputTracker.setDisabled(false);
inputTracker.maxVal = 1.0;
}
inputTracker.setValue(vlc.input.position);
info.innerHTML = formatTime(vlc.input.time)+"/"+formatTime(mediaLen);
}
else
{
// non-seekable "live" media
if( inputTracker.maxVal != 0.0 )
{
inputTracker.maxVal = 0.0;
inputTracker.setValue(0.0);
inputTracker.setDisabled(true);
}
liveFeedRoll = liveFeedRoll & 3;
info.innerHTML = liveFeedText[liveFeedRoll++];
}
inputTrackerIgnoreChange = false;
}
};
function onPause()
{
document.getElementById("state").innerHTML = "Paused...";
document.getElementById("PlayOrPause").value = " Play ";
};
function onStop()
{
// disable logging
vlc.log.verbosity = -1;
if( ! inputTracker.disabled )
{
inputTracker.setValue(inputTracker.minVal);
inputTracker.setDisabled(true);
}
document.getElementById("info").innerHTML = "-:--:--/-:--:--";
document.getElementById("state").innerHTML = "Stopped...";
document.getElementById("PlayOrPause").value = " Play ";
};
function onError()
{
var vlc = getVLC("vlc");
document.getElementById("state").innerHTML = "Error...";
if( vlc.log.messages.count > 0 )
{
// there is one or more messages in the log
var iter = vlc.log.messages.iterator();
while( iter.hasNext )
{
var msg = iter.next();
if( msg.severity <= 1 )
{
alert( msg.message );
}
document.getElementById("message").innerHTML = msg.message;
}
// clear the log once finished to avoid clogging
vlc.log.messages.clear();
}
};
function onInputTrackerScrollStart()
{
inputTrackerScrolling = true;
};
function onInputTrackerScrollEnd(inputTracker, value, pos)
{
inputTrackerScrolling = false;
};
function onInputTrackerChange(inputTracker, value, pos)
{
if( ! inputTrackerIgnoreChange )
{
var vlc = getVLC("vlc");
if( (vlc.input.state == 3) && (vlc.input.position != value) )
{
var info = document.getElementById("info");
vlc.input.position = value;
info.innerHTML = formatTime(vlc.input.time)+"/"+formatTime(vlc.input.length);
}
}
};
//-->
</SCRIPT>
</BODY>
</HTML>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment