X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=projects%2Fmozilla%2Ftest.html;h=b736bfe34139864df4eb6f46c56286a063d6d150;hb=e2ee87feb6ed480068d8a44b8b51b13d09ee663e;hp=5733be4f619b0b8722895607abc3b692d55f7901;hpb=be9c509e4c1b7fbeffc421f472ddb9e0b0486f86;p=vlc diff --git a/projects/mozilla/test.html b/projects/mozilla/test.html index 5733be4f61..b736bfe341 100644 --- a/projects/mozilla/test.html +++ b/projects/mozilla/test.html @@ -1,154 +1,304 @@ - - -VLC Plugin test page - - - - - - - - - - - - -
-MRL: - - - -
- + + + + + - - + + - +Volume: + +-- + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + -
+MRL: + + + +
+ - - - - - - - - - - - -
- -
- -
-
-
-:--:--/-:--:--
-
Stopped...
-
-
- - -  - - - - - - - +--> + + + + + + + + + + + +
+ +
+ +
+
+
-:--:--/-:--:--
+
Stopped...
+
+
+ + +  + + + +  + + + -Volume: - --- - - -
Playlist: - - - + + + Aspect Ratio: - - - -
Messages: - -Verbosity: - - - - -
no message
-
Audio Channel: - - - -
Audio Track: - --- - - - - -
+ + +
Audio Channel: + + + +
Audio Track: + +-- + + + + + + +
Video Subtitle: -- + + +
Deinterlacing: + + + +
Marquee video filter: + + + + +
Logo video filter: + + + +
Teletext page: - +
- - - + onStop(); + } + else if( newState == 6 ) + { + // current media has ended + onEnd(); + } + else if( newState == 7 ) + { + // current media encountered error + onError(); + } +} + +/* actions */ + +function doGo(targetURL) +{ + var vlc = getVLC("vlc"); + + if( vlc ) + { + vlc.playlist.items.clear(); + while( vlc.playlist.items.count > 0 ) + { + // clear() may return before the playlist has actually been cleared + // just wait for it to finish its job + } + var options = [":rtsp-tcp"]; + var itemId = vlc.playlist.add(targetURL,"",options); + options = []; + if( itemId != -1 ) + { + // play MRL + vlc.playlist.playItem(itemId); + } + else + { + alert("cannot play at the moment !"); + } + doItemCount(); + } +} + +function doAdd(targetURL) +{ + var vlc = getVLC("vlc"); + var options = [":vout-filter=deinterlace", ":deinterlace-mode=linear"]; + if( vlc ) + { + vlc.playlist.add(targetURL, "", options); + options = []; + doItemCount(); + } +} + +function doPlayOrPause() +{ + var vlc = getVLC("vlc"); + if( vlc ) + { + if( vlc.playlist.isPlaying && canPause ) + { + vlc.playlist.togglePause(); + } + else if( vlc.playlist.items.count > 0 ) + { + vlc.playlist.play(); + } + else + { + alert('nothing to play !'); + } + } +} + +function doStop() +{ + var vlc = getVLC("vlc"); + if( vlc ) + vlc.playlist.stop(); +} + +function doPlaySlower() +{ + var vlc = getVLC("vlc"); + if( vlc ) + vlc.input.rate = vlc.input.rate / 2; +} + +function doPlayFaster() +{ + var vlc = getVLC("vlc"); + if( vlc ) + 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 */ + +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 onEnd() +{ + document.getElementById("state").innerHTML = "End..."; +} + +var liveFeedText = ["Live", "((Live))", "(( Live ))", "(( Live ))"]; +var liveFeedRoll = 0; + +function onPlaying() +{ + var vlc = getVLC("vlc"); + var info = document.getElementById("info"); + if( vlc ) + { + var mediaLen = vlc.input.length; + if( mediaLen > 0 ) + { + // seekable media + info.innerHTML = formatTime(vlc.input.time)+"/"+formatTime(mediaLen); + } + else + { + // non-seekable "live" media + liveFeedRoll = liveFeedRoll & 3; + info.innerHTML = liveFeedText[liveFeedRoll++]; + } + } +} + +function onPause() +{ + document.getElementById("state").innerHTML = "Paused..."; + document.getElementById("PlayOrPause").value = " Play "; +} + +function onStop() +{ + var vlc = getVLC("vlc"); + + 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..."; +} + +//--> + + +