Commit 57e78056 authored by Jean-Paul Saman's avatar Jean-Paul Saman Committed by Derk-Jan Hartman

mozilla: use [] array initialisation in javascript

(cherry picked from commit 86531ae8)
Signed-off-by: default avatarDerk-Jan Hartman <hartman@videolan.org>
parent 5f455214
...@@ -168,17 +168,6 @@ Insert Slider widget ...@@ -168,17 +168,6 @@ Insert Slider widget
<INPUT size=4 value="" id="removeid"><INPUT type=submit value="Delete" onClick="doRemoveItem(document.getElementById('removeid').value);"> <INPUT size=4 value="" id="removeid"><INPUT type=submit value="Delete" onClick="doRemoveItem(document.getElementById('removeid').value);">
</TD> </TD>
</TR> </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: <TR><TD>Audio Channel:
<SELECT readonly onClick='doAudioChannel(this.value);'> <SELECT readonly onClick='doAudioChannel(this.value);'>
<OPTION value=1>Stereo</OPTION> <OPTION value=1>Stereo</OPTION>
...@@ -264,16 +253,6 @@ function doReverse(rate) ...@@ -264,16 +253,6 @@ function doReverse(rate)
vlc.input.rate = -1.0 * vlc.input.rate; vlc.input.rate = -1.0 * vlc.input.rate;
} }
function doVerbosity(value)
{
var vlc = getVLC("vlc");
if( vlc )
{
vlc.log.verbosity = vlc.log.verbosity + value;
document.getElementById("verbosity").value = vlc.log.verbosity;
}
}
function doAudioChannel(value) function doAudioChannel(value)
{ {
var vlc = getVLC("vlc"); var vlc = getVLC("vlc");
...@@ -366,30 +345,6 @@ function doPlaylistClearAll() ...@@ -366,30 +345,6 @@ function doPlaylistClearAll()
} }
} }
function doMessages()
{
var vlc = getVLC("vlc");
if( 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) function updateVolume(deltaVol)
{ {
var vlc = getVLC("vlc"); var vlc = getVLC("vlc");
...@@ -478,23 +433,6 @@ function monitor() ...@@ -478,23 +433,6 @@ function monitor()
if( vlc ) if( vlc )
{ {
newState = vlc.input.state; 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( prevState != newState )
...@@ -566,13 +504,11 @@ function doGo(targetURL) ...@@ -566,13 +504,11 @@ function doGo(targetURL)
// clear() may return before the playlist has actually been cleared // clear() may return before the playlist has actually been cleared
// just wait for it to finish its job // just wait for it to finish its job
} }
var options = new Array(":rtsp-tcp"); var options = [":rtsp-tcp"];
var itemId = vlc.playlist.add(targetURL,"",options); var itemId = vlc.playlist.add(targetURL,"",options);
options = [];
if( itemId != -1 ) if( itemId != -1 )
{ {
// clear the message log and enable error logging
vlc.log.verbosity = 1;
vlc.log.messages.clear();
// play MRL // play MRL
vlc.playlist.playItem(itemId); vlc.playlist.playItem(itemId);
if( monitorTimerId == 0 ) if( monitorTimerId == 0 )
...@@ -582,8 +518,6 @@ function doGo(targetURL) ...@@ -582,8 +518,6 @@ function doGo(targetURL)
} }
else else
{ {
// disable log
vlc.log.verbosity = -1;
alert("cannot play at the moment !"); alert("cannot play at the moment !");
} }
doItemCount(); doItemCount();
...@@ -593,10 +527,11 @@ function doGo(targetURL) ...@@ -593,10 +527,11 @@ function doGo(targetURL)
function doAdd(targetURL) function doAdd(targetURL)
{ {
var vlc = getVLC("vlc"); var vlc = getVLC("vlc");
var options = new Array(":vout-filter=deinterlace", ":deinterlace-mode=linear"); var options = [":vout-filter=deinterlace", ":deinterlace-mode=linear"];
if( vlc ) if( vlc )
{ {
vlc.playlist.add(targetURL, "", options); vlc.playlist.add(targetURL, "", options);
options = [];
doItemCount(); doItemCount();
} }
} }
...@@ -613,16 +548,11 @@ function doPlayOrPause() ...@@ -613,16 +548,11 @@ function doPlayOrPause()
} }
else if( vlc.playlist.items.count > 0 ) else if( vlc.playlist.items.count > 0 )
{ {
// clear the message log and enable error logging
vlc.log.verbosity = 1;
vlc.log.messages.clear();
vlc.playlist.play(); vlc.playlist.play();
monitor(); monitor();
} }
else else
{ {
// disable log
vlc.log.verbosity = -1;
alert('nothing to play !'); alert('nothing to play !');
} }
} }
...@@ -681,9 +611,10 @@ function onPlay() ...@@ -681,9 +611,10 @@ function onPlay()
function onEnd() function onEnd()
{ {
document.getElementById("state").innerHTML = "End..."; document.getElementById("state").innerHTML = "End...";
doStop();
} }
var liveFeedText = new Array("Live", "((Live))", "(( Live ))", "(( Live ))"); var liveFeedText = ["Live", "((Live))", "(( Live ))", "(( Live ))"];
var liveFeedRoll = 0; var liveFeedRoll = 0;
function onPlaying() function onPlaying()
...@@ -738,10 +669,7 @@ function onPause() ...@@ -738,10 +669,7 @@ function onPause()
function onStop() function onStop()
{ {
// disable logging
var vlc = getVLC("vlc"); var vlc = getVLC("vlc");
if( vlc )
vlc.log.verbosity = -1;
if( inputTracker ) if( inputTracker )
{ {
...@@ -762,25 +690,6 @@ function onError() ...@@ -762,25 +690,6 @@ function onError()
var vlc = getVLC("vlc"); var vlc = getVLC("vlc");
document.getElementById("state").innerHTML = "Error..."; document.getElementById("state").innerHTML = "Error...";
if( 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 )
{
alert( msg.message );
}
document.getElementById("message").innerHTML = msg.message;
}
// clear the log once finished to avoid clogging
vlc.log.messages.clear();
}
}
} }
function onInputTrackerScrollStart() function onInputTrackerScrollStart()
......
...@@ -504,8 +504,9 @@ function doGo(targetURL) ...@@ -504,8 +504,9 @@ function doGo(targetURL)
// clear() may return before the playlist has actually been cleared // clear() may return before the playlist has actually been cleared
// just wait for it to finish its job // just wait for it to finish its job
} }
var options = new Array(":rtsp-tcp"); var options = [":rtsp-tcp"];
var itemId = vlc.playlist.add(targetURL,"",options); var itemId = vlc.playlist.add(targetURL,"",options);
options = [];
if( itemId != -1 ) if( itemId != -1 )
{ {
// play MRL // play MRL
...@@ -526,10 +527,11 @@ function doGo(targetURL) ...@@ -526,10 +527,11 @@ function doGo(targetURL)
function doAdd(targetURL) function doAdd(targetURL)
{ {
var vlc = getVLC("vlc"); var vlc = getVLC("vlc");
var options = new Array(":vout-filter=deinterlace", ":deinterlace-mode=linear"); var options = [":vout-filter=deinterlace", ":deinterlace-mode=linear"];
if( vlc ) if( vlc )
{ {
vlc.playlist.add(targetURL, "", options); vlc.playlist.add(targetURL, "", options);
options = [];
doItemCount(); doItemCount();
} }
} }
...@@ -612,7 +614,7 @@ function onEnd() ...@@ -612,7 +614,7 @@ function onEnd()
doStop(); doStop();
} }
var liveFeedText = new Array("Live", "((Live))", "(( Live ))", "(( Live ))"); var liveFeedText = ["Live", "((Live))", "(( Live ))", "(( Live ))"];
var liveFeedRoll = 0; var liveFeedRoll = 0;
function onPlaying() function onPlaying()
......
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