Commit 31a97918 authored by Jean-Paul Saman's avatar Jean-Paul Saman

mozilla: test.html fix inputTracker usage

parent 4e250dc9
...@@ -16,8 +16,11 @@ ...@@ -16,8 +16,11 @@
<SCRIPT type="text/javascript" src="blueshoes-4.5/javascript/components/slider/Bs_Slider.class.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(); inputTracker = new Bs_Slider();
if (inputTracker)
{
inputTracker.attachOnChange(onInputTrackerChange); inputTracker.attachOnChange(onInputTrackerChange);
inputTracker.attachOnSlideStart(onInputTrackerScrollStart); inputTracker.attachOnSlideStart(onInputTrackerScrollStart);
inputTracker.attachOnSlideEnd(onInputTrackerScrollEnd); inputTracker.attachOnSlideEnd(onInputTrackerScrollEnd);
...@@ -35,6 +38,7 @@ function init(){ ...@@ -35,6 +38,7 @@ function init(){
inputTracker.setSliderIcon('aluminumalloyvolcanic/horizontal_knob.gif', 15, 19); inputTracker.setSliderIcon('aluminumalloyvolcanic/horizontal_knob.gif', 15, 19);
inputTracker.useInputField = 0; inputTracker.useInputField = 0;
inputTracker.draw('inputTrackerDiv'); inputTracker.draw('inputTrackerDiv');
}
if( navigator.appName.indexOf("Microsoft Internet")==-1 ) if( navigator.appName.indexOf("Microsoft Internet")==-1 )
{ {
...@@ -47,7 +51,8 @@ function init(){ ...@@ -47,7 +51,8 @@ function init(){
else else
{ {
/* Explorer loads plugins asynchronously */ /* Explorer loads plugins asynchronously */
document.onreadystatechange=function() { document.onreadystatechange=function()
{
if( document.readyState == 'complete' ) if( document.readyState == 'complete' )
{ {
onVLCPluginReady(); onVLCPluginReady();
...@@ -219,6 +224,7 @@ var rate = 0; ...@@ -219,6 +224,7 @@ var rate = 0;
var prevState = 0; var prevState = 0;
var monitorTimerId = 0; var monitorTimerId = 0;
var rateTimerId = 0; var rateTimerId = 0;
var inputTracker;
var inputTrackerScrolling = false; var inputTrackerScrolling = false;
var inputTrackerIgnoreChange = false; var inputTrackerIgnoreChange = false;
var telxState = false; var telxState = false;
...@@ -677,7 +683,7 @@ var liveFeedRoll = 0; ...@@ -677,7 +683,7 @@ var liveFeedRoll = 0;
function onPlaying() function onPlaying()
{ {
if( ! inputTrackerScrolling ) if( !inputTrackerScrolling )
{ {
var vlc = getVLC("vlc"); var vlc = getVLC("vlc");
var info = document.getElementById("info"); var info = document.getElementById("info");
...@@ -686,23 +692,29 @@ function onPlaying() ...@@ -686,23 +692,29 @@ function onPlaying()
if( mediaLen > 0 ) if( mediaLen > 0 )
{ {
// seekable media // seekable media
if( inputTracker )
{
if( inputTracker.maxVal == 1.0 ) if( inputTracker.maxVal == 1.0 )
{ {
inputTracker.setDisabled(false); inputTracker.setDisabled(false);
inputTracker.maxVal = 1.0; inputTracker.maxVal = 1.0;
} }
inputTracker.setValue(vlc.input.position); 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 ) if( inputTracker.maxVal != 0.0 )
{ {
inputTracker.maxVal = 0.0; inputTracker.maxVal = 0.0;
inputTracker.setValue(0.0); inputTracker.setValue(0.0);
inputTracker.setDisabled(true); inputTracker.setDisabled(true);
} }
}
liveFeedRoll = liveFeedRoll & 3; liveFeedRoll = liveFeedRoll & 3;
info.innerHTML = liveFeedText[liveFeedRoll++]; info.innerHTML = liveFeedText[liveFeedRoll++];
} }
...@@ -721,11 +733,14 @@ function onStop() ...@@ -721,11 +733,14 @@ function onStop()
// disable logging // disable logging
vlc.log.verbosity = -1; vlc.log.verbosity = -1;
if( inputTracker )
{
if( !inputTracker.disabled ) if( !inputTracker.disabled )
{ {
inputTracker.setValue(inputTracker.minVal); inputTracker.setValue(inputTracker.minVal);
inputTracker.setDisabled(true); 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 ";
......
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