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

mozilla: activex: update test.html

- use VLC MediaPlayer events
- use unix style EOL
parent 366cc4b9
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML> <HTML>
<TITLE>VLC Plugin test page</TITLE> <TITLE>VLC Plugin test page</TITLE>
<STYLE>
.inputTrackerInput {
height:20;
width:30;
font-family : Arial, Helvetica, sans-serif;
font-size : 12px;
}
</STYLE>
<SCRIPT type="text/javascript" src="blueshoes-4.5/javascript/lib/LibCrossBrowser.js"></SCRIPT>
<SCRIPT type="text/javascript" src="blueshoes-4.5/javascript/lib/EventHandler.js"></SCRIPT>
<SCRIPT type="text/javascript" src="blueshoes-4.5/javascript/core/form/Bs_FormUtil.lib.js"></SCRIPT>
<SCRIPT type="text/javascript" src="blueshoes-4.5/javascript/components/slider/Bs_Slider.class.js"></SCRIPT>
<SCRIPT language="JavaScript"><!-- <SCRIPT language="JavaScript"><!--
function init() function init()
{ {
inputTracker = new Bs_Slider();
if (inputTracker)
{
inputTracker.attachOnChange(onInputTrackerChange);
inputTracker.attachOnSlideStart(onInputTrackerScrollStart);
inputTracker.attachOnSlideEnd(onInputTrackerScrollEnd);
inputTracker.width = 530;
inputTracker.height = 15;
inputTracker.minVal = 0;
inputTracker.maxVal = 1.0;
inputTracker.valueDefault = 0;
inputTracker.valueInterval = 1/530;
inputTracker.setDisabled(true);
inputTracker.imgDir = 'blueshoes-4.5/javascript/components/slider/img/';
inputTracker.setBackgroundImage('aluminumalloyvolcanic/horizontal_background.gif', 'repeat');
inputTracker.setArrowIconLeft('aluminumalloyvolcanic/horizontal_backgroundLeft.gif', 2, 19);
inputTracker.setArrowIconRight('aluminumalloyvolcanic/horizontal_backgroundRight.gif', 2, 19);
inputTracker.setSliderIcon('aluminumalloyvolcanic/horizontal_knob.gif', 15, 19);
inputTracker.useInputField = 0;
inputTracker.draw('inputTrackerDiv');
}
if( navigator.appName.indexOf("Microsoft Internet")==-1 ) if( navigator.appName.indexOf("Microsoft Internet")==-1 )
{ {
onVLCPluginReady() onVLCPluginReady()
...@@ -43,14 +78,189 @@ function getVLC(name) ...@@ -43,14 +78,189 @@ function getVLC(name)
} }
} }
function registerVLCEvent(event, handler)
{
var vlc = getVLC("vlc");
if (vlc) {
if (vlc.attachEvent) {
// Microsoft
vlc.attachEvent (event, handler);
} else if (vlc.addEventListener) {
// Mozilla: DOM level 2
vlc.addEventListener (event, handler, true);
} else {
// DOM level 0
eval("vlc.on" + event + " = handler");
}
}
}
function unregisterVLCEvent(event, handler)
{
var vlc = getVLC("vlc");
if (vlc) {
if (vlc.detachEvent) {
// Microsoft
vlc.detachEvent (event, handler);
} else if (vlc.removeEventListener) {
// Mozilla: DOM level 2
vlc.removeEventListener (event, handler, true);
} else {
// DOM level 0
eval("vlc.on" + event + " = null");
}
}
}
// JS VLC API callbacks
function handleMediaPlayerMediaChanged()
{
document.getElementById("info").innerHTML = "Media Changed";
}
function handle_MediaPlayerNothingSpecial()
{
document.getElementById("state").innerHTML = "Idle...";
}
function handle_MediaPlayerOpening()
{
onOpen();
}
function handle_MediaPlayerBuffering(val)
{
document.getElementById("info").innerHTML = val + "%";
}
function handle_MediaPlayerPlaying()
{
onPlay();
}
function handle_MediaPlayerPaused()
{
onPause();
}
function handle_MediaPlayerStopped()
{
onStop();
}
function handle_MediaPlayerForward()
{
document.getElementById("state").innerHTML = "Forward...";
}
function handle_MediaPlayerBackward()
{
document.getElementById("state").innerHTML = "Backward...";
}
function handle_MediaPlayerEndReached()
{
onEnd();
}
function handle_MediaPlayerEncounteredError()
{
onError();
}
function handle_MediaPlayerTimeChanged(time)
{
var vlc = getVLC("vlc");
var info = document.getElementById("info");
if( vlc )
{
var mediaLen = vlc.input.length;
if( mediaLen > 0 )
{
// seekable media
info.innerHTML = formatTime(time)+"/"+formatTime(mediaLen);
}
}
}
function handle_MediaPlayerPositionChanged(val)
{
// set javascript slider to correct position
}
function handle_MediaPlayerSeekableChanged(val)
{
setSeekable(val);
}
function handle_MediaPlayerPausableChanged(val)
{
setPauseable(val);
}
function handle_MediaPlayerTitleChanged(val)
{
//setTitle(val);
document.getElementById("info").innerHTML = "Title: " + val;
}
function handle_MediaPlayerLengthChanged(val)
{
//setMediaLength(val);
}
// VLC Plugin
function onVLCPluginReady() function onVLCPluginReady()
{ {
updateVolume(0); registerVLCEvent("MediaPlayerMediaChanged", handleMediaPlayerMediaChanged);
registerVLCEvent("MediaPlayerNothingSpecial", handle_MediaPlayerNothingSpecial);
registerVLCEvent("MediaPlayerOpening", handle_MediaPlayerOpening);
registerVLCEvent("MediaPlayerBuffering", handle_MediaPlayerBuffering);
registerVLCEvent("MediaPlayerPlaying", handle_MediaPlayerPlaying);
registerVLCEvent("MediaPlayerPaused", handle_MediaPlayerPaused);
registerVLCEvent("MediaPlayerStopped", handle_MediaPlayerStopped);
registerVLCEvent("MediaPlayerForward", handle_MediaPlayerForward);
registerVLCEvent("MediaPlayerBackward", handle_MediaPlayerBackward);
registerVLCEvent("MediaPlayerEndReached", handle_MediaPlayerEndReached);
registerVLCEvent("MediaPlayerEncounteredError", handle_MediaPlayerEncounteredError);
registerVLCEvent("MediaPlayerTimeChanged", handle_MediaPlayerTimeChanged);
registerVLCEvent("MediaPlayerPositionChanged", handle_MediaPlayerPositionChanged);
registerVLCEvent("MediaPlayerSeekableChanged", handle_MediaPlayerSeekableChanged);
registerVLCEvent("MediaPlayerPausableChanged", handle_MediaPlayerPausableChanged);
registerVLCEvent("MediaPlayerTitleChanged", handle_MediaPlayerTitleChanged);
registerVLCEvent("MediaPlayerLengthChanged", handle_MediaPlayerLengthChanged);
}
function close()
{
unregisterVLCEvent('MediaPlayerMouseGrab', handleMouseGrab);
unregisterVLCEvent('MediaPlayerMouseRelease', handleMouseRelease);
unregisterVLCEvent('MediaPlayerMouseClick', handleMouseClick);
unregisterVLCEvent("MediaPlayerMediaChanged", handleMediaPlayerMediaChanged);
unregisterVLCEvent("MediaPlayerNothingSpecial", handle_MediaPlayerNothingSpecial);
unregisterVLCEvent("MediaPlayerOpening", handle_MediaPlayerOpening);
unregisterVLCEvent("MediaPlayerBuffering", handle_MediaPlayerBuffering);
unregisterVLCEvent("MediaPlayerPlaying", handle_MediaPlayerPlaying);
unregisterVLCEvent("MediaPlayerPaused", handle_MediaPlayerPaused);
unregisterVLCEvent("MediaPlayerStopped", handle_MediaPlayerStopped);
unregisterVLCEvent("MediaPlayerForward", handle_MediaPlayerForward);
unregisterVLCEvent("MediaPlayerBackward", handle_MediaPlayerBackward);
unregisterVLCEvent("MediaPlayerEndReached", handle_MediaPlayerEndReached);
unregisterVLCEvent("MediaPlayerEncounteredError", handle_MediaPlayerEncounteredError);
unregisterVLCEvent("MediaPlayerTimeChanged", handle_MediaPlayerTimeChanged);
unregisterVLCEvent("MediaPlayerPositionChanged", handle_MediaPlayerPositionChanged);
unregisterVLCEvent("MediaPlayerSeekableChanged", handle_MediaPlayerSeekableChanged);
unregisterVLCEvent("MediaPlayerPausableChanged", handle_MediaPlayerPausableChanged);
unregisterVLCEvent("MediaPlayerTitleChanged", handle_MediaPlayerTitleChanged);
unregisterVLCEvent("MediaPlayerLengthChanged", handle_MediaPlayerLengthChanged);
} }
//--></SCRIPT> //--></SCRIPT>
<BODY onLoad="init();"> <BODY onLoad="init();" onClose="close();>
<TABLE> <TABLE>
<TR><TD colspan="2"> <TR><TD colspan="2">
MRL: MRL:
...@@ -91,6 +301,7 @@ Insert VideoLAN.VLCPlugin.2 ...@@ -91,6 +301,7 @@ Insert VideoLAN.VLCPlugin.2
<!-- <!--
Insert Slider widget Insert Slider widget
--> -->
<DIV id="inputTrackerDiv"</DIV>
</TD><TD width="15%"> </TD><TD width="15%">
<DIV id="info" style="text-align:center">-:--:--/-:--:--</DIV> <DIV id="info" style="text-align:center">-:--:--/-:--:--</DIV>
<DIV id="state" style="text-align:center">Stopped...</DIV> <DIV id="state" style="text-align:center">Stopped...</DIV>
...@@ -221,7 +432,23 @@ Insert Slider widget ...@@ -221,7 +432,23 @@ Insert Slider widget
var rate = 0; var rate = 0;
var prevState = 0; var prevState = 0;
var monitorTimerId = 0;
var inputTracker;
var inputTrackerScrolling = false;
var inputTrackerIgnoreChange = false;
var telxState = false; var telxState = false;
var canPause = true;
var canSeek = true;
function setPauseable(val)
{
canPause = val;
}
function setSeekable(val)
{
canSeek = val;
}
function doSetSlider() function doSetSlider()
{ {
...@@ -479,6 +706,10 @@ function monitor() ...@@ -479,6 +706,10 @@ function monitor()
// current media is playing // current media is playing
onPlaying(); onPlaying();
} }
if( monitorTimerId == 0 )
{
monitorTimerId = setInterval("monitor()", 1000);
}
}; };
/* actions */ /* actions */
...@@ -502,8 +733,11 @@ function doGo(targetURL) ...@@ -502,8 +733,11 @@ function doGo(targetURL)
{ {
// play MRL // play MRL
vlc.playlist.playItem(itemId); vlc.playlist.playItem(itemId);
if( monitorTimerId == 0 )
{
monitor(); monitor();
} }
}
else else
{ {
alert("cannot play at the moment !"); alert("cannot play at the moment !");
...@@ -529,15 +763,15 @@ function doPlayOrPause() ...@@ -529,15 +763,15 @@ function doPlayOrPause()
var vlc = getVLC("vlc"); var vlc = getVLC("vlc");
if( vlc ) if( vlc )
{ {
if( vlc.playlist.isPlaying ) if( vlc.playlist.isPlaying && canPause )
{ {
vlc.playlist.togglePause(); vlc.playlist.togglePause();
monitor(); //monitor();
} }
else if( vlc.playlist.items.count > 0 ) else if( vlc.playlist.items.count > 0 )
{ {
vlc.playlist.play(); vlc.playlist.play();
monitor(); //monitor();
} }
else else
{ {
...@@ -553,6 +787,11 @@ function doStop() ...@@ -553,6 +787,11 @@ function doStop()
if( vlc ) if( vlc )
vlc.playlist.stop(); vlc.playlist.stop();
if( monitorTimerId != 0 )
{
clearInterval(monitorTimerId);
monitorTimerId = 0;
}
onStop(); onStop();
} }
...@@ -570,6 +809,56 @@ function doPlayFaster() ...@@ -570,6 +809,56 @@ function doPlayFaster()
vlc.input.rate = vlc.input.rate * 2; vlc.input.rate = vlc.input.rate * 2;
} }
function doMarqueeOption(option, value)
{
var vlc = getVLC("vlc");
val = parseInt(value);
if( vlc )
{
if (option == 1)
vlc.video.marquee.color = val;
if (option == 2)
vlc.video.marquee.opacity = val;
if (option == 3)
vlc.video.marquee.position = value;
if (option == 4)
vlc.video.marquee.refresh = val;
if (option == 5)
vlc.video.marquee.size = val;
if (option == 6)
vlc.video.marquee.text = value;
if (option == 7)
vlc.video.marquee.timeout = val;
if (option == 8)
vlc.video.marquee.x = val;
if (option == 9)
vlc.video.marquee.y = val;
}
}
function doLogoOption(option, value)
{
var vlc = getVLC("vlc");
if( vlc )
{
if (option == 1)
vlc.video.logo.file(value);
if (option == 2)
vlc.video.logo.position = value;
val = parseInt(value);
if (option == 3)
vlc.video.logo.opacity = val;
if (option == 4)
vlc.video.logo.repeat = val;
if (option == 5)
vlc.video.logo.delay = val;
if (option == 6)
vlc.video.logo.x = val;
if (option == 7)
vlc.video.logo.y = val;
}
}
/* events */ /* events */
function onOpen() function onOpen()
...@@ -594,7 +883,6 @@ function onPlay() ...@@ -594,7 +883,6 @@ function onPlay()
function onEnd() function onEnd()
{ {
document.getElementById("state").innerHTML = "End..."; document.getElementById("state").innerHTML = "End...";
doStop();
} }
var liveFeedText = ["Live", "((Live))", "(( Live ))", "(( Live ))"]; var liveFeedText = ["Live", "((Live))", "(( Live ))", "(( Live ))"];
...@@ -602,21 +890,44 @@ var liveFeedRoll = 0; ...@@ -602,21 +890,44 @@ var liveFeedRoll = 0;
function onPlaying() function onPlaying()
{ {
if( !inputTrackerScrolling )
{
var vlc = getVLC("vlc"); var vlc = getVLC("vlc");
var info = document.getElementById("info"); var info = document.getElementById("info");
if( vlc ) if( vlc )
{ {
var mediaLen = vlc.input.length; var mediaLen = vlc.input.length;
inputTrackerIgnoreChange = true;
if( mediaLen > 0 ) if( mediaLen > 0 )
{ {
// seekable media
if( inputTracker )
{
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); info.innerHTML = formatTime(vlc.input.time)+"/"+formatTime(mediaLen);
} }
else else
{ {
// non-seekable "live" media // non-seekable "live" media
if( inputTracker )
{
if( inputTracker.maxVal != 0.0 )
{
inputTracker.maxVal = 0.0;
inputTracker.setValue(0.0);
inputTracker.setDisabled(true);
}
}
liveFeedRoll = liveFeedRoll & 3; liveFeedRoll = liveFeedRoll & 3;
info.innerHTML = liveFeedText[liveFeedRoll++]; info.innerHTML = liveFeedText[liveFeedRoll++];
} }
inputTrackerIgnoreChange = false;
} }
} }
} }
...@@ -629,6 +940,17 @@ function onPause() ...@@ -629,6 +940,17 @@ function onPause()
function onStop() function onStop()
{ {
var vlc = getVLC("vlc");
if( inputTracker )
{
if( !inputTracker.disabled )
{
inputTracker.setValue(inputTracker.minVal);
inputTracker.setDisabled(true);
}
}
document.getElementById("info").innerHTML = "-:--:--/-:--:--"; document.getElementById("info").innerHTML = "-:--:--/-:--:--";
document.getElementById("state").innerHTML = "Stopped..."; document.getElementById("state").innerHTML = "Stopped...";
document.getElementById("PlayOrPause").value = " Play "; document.getElementById("PlayOrPause").value = " Play ";
...@@ -636,56 +958,35 @@ function onStop() ...@@ -636,56 +958,35 @@ function onStop()
function onError() function onError()
{ {
var vlc = getVLC("vlc");
document.getElementById("state").innerHTML = "Error..."; document.getElementById("state").innerHTML = "Error...";
} }
function doMarqueeOption(option, value) function onInputTrackerScrollStart()
{ {
var vlc = getVLC("vlc"); inputTrackerScrolling = true;
val = parseInt(value);
if( vlc )
{
if (option == 1)
vlc.video.marquee.color = val;
if (option == 2)
vlc.video.marquee.opacity = val;
if (option == 3)
vlc.video.marquee.position = value;
if (option == 4)
vlc.video.marquee.refresh = val;
if (option == 5)
vlc.video.marquee.size = val;
if (option == 6)
vlc.video.marquee.text = value;
if (option == 7)
vlc.video.marquee.timeout = val;
if (option == 8)
vlc.video.marquee.x = val;
if (option == 9)
vlc.video.marquee.y = val;
}
} }
function doLogoOption(option, value) function onInputTrackerScrollEnd(inputTracker, value, pos)
{ {
inputTrackerScrolling = false;
}
function onInputTrackerChange(inputTracker, value, pos)
{
if( !inputTrackerIgnoreChange )
{
var vlc = getVLC("vlc"); var vlc = getVLC("vlc");
if( vlc ) if( vlc )
{ {
if (option == 1) if( (vlc.input.state == 3) && (vlc.input.position != value) )
vlc.video.logo.file(value); {
if (option == 2) var info = document.getElementById("info");
vlc.video.logo.position = value; vlc.input.position = value;
val = parseInt(value); info.innerHTML = formatTime(vlc.input.time)+"/"+formatTime(vlc.input.length);
if (option == 3) }
vlc.video.logo.opacity = val; }
if (option == 4)
vlc.video.logo.repeat = val;
if (option == 5)
vlc.video.logo.delay = val;
if (option == 6)
vlc.video.logo.x = val;
if (option == 7)
vlc.video.logo.y = val;
} }
} }
......
...@@ -24,7 +24,7 @@ function init() ...@@ -24,7 +24,7 @@ function init()
inputTracker.attachOnChange(onInputTrackerChange); inputTracker.attachOnChange(onInputTrackerChange);
inputTracker.attachOnSlideStart(onInputTrackerScrollStart); inputTracker.attachOnSlideStart(onInputTrackerScrollStart);
inputTracker.attachOnSlideEnd(onInputTrackerScrollEnd); inputTracker.attachOnSlideEnd(onInputTrackerScrollEnd);
inputTracker.width = 530 ; inputTracker.width = 530;
inputTracker.height = 15; inputTracker.height = 15;
inputTracker.minVal = 0; inputTracker.minVal = 0;
inputTracker.maxVal = 1.0; inputTracker.maxVal = 1.0;
...@@ -78,14 +78,189 @@ function getVLC(name) ...@@ -78,14 +78,189 @@ function getVLC(name)
} }
} }
function registerVLCEvent(event, handler)
{
var vlc = getVLC("vlc");
if (vlc) {
if (vlc.attachEvent) {
// Microsoft
vlc.attachEvent (event, handler);
} else if (vlc.addEventListener) {
// Mozilla: DOM level 2
vlc.addEventListener (event, handler, true);
} else {
// DOM level 0
eval("vlc.on" + event + " = handler");
}
}
}
function unregisterVLCEvent(event, handler)
{
var vlc = getVLC("vlc");
if (vlc) {
if (vlc.detachEvent) {
// Microsoft
vlc.detachEvent (event, handler);
} else if (vlc.removeEventListener) {
// Mozilla: DOM level 2
vlc.removeEventListener (event, handler, true);
} else {
// DOM level 0
eval("vlc.on" + event + " = null");
}
}
}
// JS VLC API callbacks
function handleMediaPlayerMediaChanged()
{
document.getElementById("info").innerHTML = "Media Changed";
}
function handle_MediaPlayerNothingSpecial()
{
document.getElementById("state").innerHTML = "Idle...";
}
function handle_MediaPlayerOpening()
{
onOpen();
}
function handle_MediaPlayerBuffering(val)
{
document.getElementById("info").innerHTML = val + "%";
}
function handle_MediaPlayerPlaying()
{
onPlay();
}
function handle_MediaPlayerPaused()
{
onPause();
}
function handle_MediaPlayerStopped()
{
onStop();
}
function handle_MediaPlayerForward()
{
document.getElementById("state").innerHTML = "Forward...";
}
function handle_MediaPlayerBackward()
{
document.getElementById("state").innerHTML = "Backward...";
}
function handle_MediaPlayerEndReached()
{
onEnd();
}
function handle_MediaPlayerEncounteredError()
{
onError();
}
function handle_MediaPlayerTimeChanged(time)
{
var vlc = getVLC("vlc");
var info = document.getElementById("info");
if( vlc )
{
var mediaLen = vlc.input.length;
if( mediaLen > 0 )
{
// seekable media
info.innerHTML = formatTime(time)+"/"+formatTime(mediaLen);
}
}
}
function handle_MediaPlayerPositionChanged(val)
{
// set javascript slider to correct position
}
function handle_MediaPlayerSeekableChanged(val)
{
setSeekable(val);
}
function handle_MediaPlayerPausableChanged(val)
{
setPauseable(val);
}
function handle_MediaPlayerTitleChanged(val)
{
//setTitle(val);
document.getElementById("info").innerHTML = "Title: " + val;
}
function handle_MediaPlayerLengthChanged(val)
{
//setMediaLength(val);
}
// VLC Plugin
function onVLCPluginReady() function onVLCPluginReady()
{ {
updateVolume(0); registerVLCEvent("MediaPlayerMediaChanged", handleMediaPlayerMediaChanged);
registerVLCEvent("MediaPlayerNothingSpecial", handle_MediaPlayerNothingSpecial);
registerVLCEvent("MediaPlayerOpening", handle_MediaPlayerOpening);
registerVLCEvent("MediaPlayerBuffering", handle_MediaPlayerBuffering);
registerVLCEvent("MediaPlayerPlaying", handle_MediaPlayerPlaying);
registerVLCEvent("MediaPlayerPaused", handle_MediaPlayerPaused);
registerVLCEvent("MediaPlayerStopped", handle_MediaPlayerStopped);
registerVLCEvent("MediaPlayerForward", handle_MediaPlayerForward);
registerVLCEvent("MediaPlayerBackward", handle_MediaPlayerBackward);
registerVLCEvent("MediaPlayerEndReached", handle_MediaPlayerEndReached);
registerVLCEvent("MediaPlayerEncounteredError", handle_MediaPlayerEncounteredError);
registerVLCEvent("MediaPlayerTimeChanged", handle_MediaPlayerTimeChanged);
registerVLCEvent("MediaPlayerPositionChanged", handle_MediaPlayerPositionChanged);
registerVLCEvent("MediaPlayerSeekableChanged", handle_MediaPlayerSeekableChanged);
registerVLCEvent("MediaPlayerPausableChanged", handle_MediaPlayerPausableChanged);
registerVLCEvent("MediaPlayerTitleChanged", handle_MediaPlayerTitleChanged);
registerVLCEvent("MediaPlayerLengthChanged", handle_MediaPlayerLengthChanged);
}
function close()
{
unregisterVLCEvent('MediaPlayerMouseGrab', handleMouseGrab);
unregisterVLCEvent('MediaPlayerMouseRelease', handleMouseRelease);
unregisterVLCEvent('MediaPlayerMouseClick', handleMouseClick);
unregisterVLCEvent("MediaPlayerMediaChanged", handleMediaPlayerMediaChanged);
unregisterVLCEvent("MediaPlayerNothingSpecial", handle_MediaPlayerNothingSpecial);
unregisterVLCEvent("MediaPlayerOpening", handle_MediaPlayerOpening);
unregisterVLCEvent("MediaPlayerBuffering", handle_MediaPlayerBuffering);
unregisterVLCEvent("MediaPlayerPlaying", handle_MediaPlayerPlaying);
unregisterVLCEvent("MediaPlayerPaused", handle_MediaPlayerPaused);
unregisterVLCEvent("MediaPlayerStopped", handle_MediaPlayerStopped);
unregisterVLCEvent("MediaPlayerForward", handle_MediaPlayerForward);
unregisterVLCEvent("MediaPlayerBackward", handle_MediaPlayerBackward);
unregisterVLCEvent("MediaPlayerEndReached", handle_MediaPlayerEndReached);
unregisterVLCEvent("MediaPlayerEncounteredError", handle_MediaPlayerEncounteredError);
unregisterVLCEvent("MediaPlayerTimeChanged", handle_MediaPlayerTimeChanged);
unregisterVLCEvent("MediaPlayerPositionChanged", handle_MediaPlayerPositionChanged);
unregisterVLCEvent("MediaPlayerSeekableChanged", handle_MediaPlayerSeekableChanged);
unregisterVLCEvent("MediaPlayerPausableChanged", handle_MediaPlayerPausableChanged);
unregisterVLCEvent("MediaPlayerTitleChanged", handle_MediaPlayerTitleChanged);
unregisterVLCEvent("MediaPlayerLengthChanged", handle_MediaPlayerLengthChanged);
} }
//--></SCRIPT> //--></SCRIPT>
<BODY onLoad="init();"> <BODY onLoad="init();" onClose="close();">
<TABLE> <TABLE>
<TR><TD colspan="2"> <TR><TD colspan="2">
MRL: MRL:
...@@ -262,6 +437,18 @@ var inputTracker; ...@@ -262,6 +437,18 @@ var inputTracker;
var inputTrackerScrolling = false; var inputTrackerScrolling = false;
var inputTrackerIgnoreChange = false; var inputTrackerIgnoreChange = false;
var telxState = false; var telxState = false;
var canPause = true;
var canSeek = true;
function setPauseable(val)
{
canPause = val;
}
function setSeekable(val)
{
canSeek = val;
}
function doSetSlider() function doSetSlider()
{ {
...@@ -576,15 +763,15 @@ function doPlayOrPause() ...@@ -576,15 +763,15 @@ function doPlayOrPause()
var vlc = getVLC("vlc"); var vlc = getVLC("vlc");
if( vlc ) if( vlc )
{ {
if( vlc.playlist.isPlaying ) if( vlc.playlist.isPlaying && canPause )
{ {
vlc.playlist.togglePause(); vlc.playlist.togglePause();
monitor(); //monitor();
} }
else if( vlc.playlist.items.count > 0 ) else if( vlc.playlist.items.count > 0 )
{ {
vlc.playlist.play(); vlc.playlist.play();
monitor(); //monitor();
} }
else else
{ {
...@@ -622,6 +809,56 @@ function doPlayFaster() ...@@ -622,6 +809,56 @@ function doPlayFaster()
vlc.input.rate = vlc.input.rate * 2; vlc.input.rate = vlc.input.rate * 2;
} }
function doMarqueeOption(option, value)
{
var vlc = getVLC("vlc");
val = parseInt(value);
if( vlc )
{
if (option == 1)
vlc.video.marquee.color = val;
if (option == 2)
vlc.video.marquee.opacity = val;
if (option == 3)
vlc.video.marquee.position = value;
if (option == 4)
vlc.video.marquee.refresh = val;
if (option == 5)
vlc.video.marquee.size = val;
if (option == 6)
vlc.video.marquee.text = value;
if (option == 7)
vlc.video.marquee.timeout = val;
if (option == 8)
vlc.video.marquee.x = val;
if (option == 9)
vlc.video.marquee.y = val;
}
}
function doLogoOption(option, value)
{
var vlc = getVLC("vlc");
if( vlc )
{
if (option == 1)
vlc.video.logo.file(value);
if (option == 2)
vlc.video.logo.position = value;
val = parseInt(value);
if (option == 3)
vlc.video.logo.opacity = val;
if (option == 4)
vlc.video.logo.repeat = val;
if (option == 5)
vlc.video.logo.delay = val;
if (option == 6)
vlc.video.logo.x = val;
if (option == 7)
vlc.video.logo.y = val;
}
}
/* events */ /* events */
function onOpen() function onOpen()
...@@ -646,7 +883,6 @@ function onPlay() ...@@ -646,7 +883,6 @@ function onPlay()
function onEnd() function onEnd()
{ {
document.getElementById("state").innerHTML = "End..."; document.getElementById("state").innerHTML = "End...";
doStop();
} }
var liveFeedText = ["Live", "((Live))", "(( Live ))", "(( Live ))"]; var liveFeedText = ["Live", "((Live))", "(( Live ))", "(( Live ))"];
...@@ -754,56 +990,6 @@ function onInputTrackerChange(inputTracker, value, pos) ...@@ -754,56 +990,6 @@ function onInputTrackerChange(inputTracker, value, pos)
} }
} }
function doMarqueeOption(option, value)
{
var vlc = getVLC("vlc");
val = parseInt(value);
if( vlc )
{
if (option == 1)
vlc.video.marquee.color = val;
if (option == 2)
vlc.video.marquee.opacity = val;
if (option == 3)
vlc.video.marquee.position = value;
if (option == 4)
vlc.video.marquee.refresh = val;
if (option == 5)
vlc.video.marquee.size = val;
if (option == 6)
vlc.video.marquee.text = value;
if (option == 7)
vlc.video.marquee.timeout = val;
if (option == 8)
vlc.video.marquee.x = val;
if (option == 9)
vlc.video.marquee.y = val;
}
}
function doLogoOption(option, value)
{
var vlc = getVLC("vlc");
if( vlc )
{
if (option == 1)
vlc.video.logo.file(value);
if (option == 2)
vlc.video.logo.position = value;
val = parseInt(value);
if (option == 3)
vlc.video.logo.opacity = val;
if (option == 4)
vlc.video.logo.repeat = val;
if (option == 5)
vlc.video.logo.delay = val;
if (option == 6)
vlc.video.logo.x = val;
if (option == 7)
vlc.video.logo.y = val;
}
}
//--> //-->
</SCRIPT> </SCRIPT>
</BODY> </BODY>
......
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