Commit a1f445c3 authored by Daniel Amm's avatar Daniel Amm Committed by Jean-Baptiste Kempf

test pages: fix live media animation

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent f5913acb
...@@ -168,6 +168,12 @@ function handle_MediaPlayerTimeChanged(time) ...@@ -168,6 +168,12 @@ function handle_MediaPlayerTimeChanged(time)
// seekable media // seekable media
info.innerHTML = formatTime(time)+"/"+formatTime(mediaLen); info.innerHTML = formatTime(time)+"/"+formatTime(mediaLen);
} }
else
{
// non-seekable "live" media
liveFeedRoll = liveFeedRoll & 3;
info.innerHTML = liveFeedText[liveFeedRoll++];
}
} }
} }
...@@ -456,8 +462,8 @@ function close() ...@@ -456,8 +462,8 @@ function close()
<!-- <!--
var telxState = false; var telxState = false;
var canPause = true; var canPause = false;
var canSeek = true; var canSeek = false;
function setPauseable(val) function setPauseable(val)
{ {
...@@ -467,6 +473,8 @@ function setPauseable(val) ...@@ -467,6 +473,8 @@ function setPauseable(val)
function setSeekable(val) function setSeekable(val)
{ {
canSeek = val; canSeek = val;
if( liveFeedRoll != 0 )
liveFeedRoll = 0;
} }
function doSetSlider() function doSetSlider()
...@@ -802,6 +810,7 @@ function onOpen() ...@@ -802,6 +810,7 @@ function onOpen()
{ {
document.getElementById("state").innerHTML = "Opening..."; document.getElementById("state").innerHTML = "Opening...";
document.getElementById("PlayOrPause").value = "Pause"; document.getElementById("PlayOrPause").value = "Pause";
setSeekable(false);
} }
function onBuffer() function onBuffer()
...@@ -820,9 +829,10 @@ function onPlay() ...@@ -820,9 +829,10 @@ function onPlay()
function onEnd() function onEnd()
{ {
document.getElementById("state").innerHTML = "End..."; document.getElementById("state").innerHTML = "End...";
setSeekable(false);
} }
var liveFeedText = ["Live", "((Live))", "(( Live ))", "(( Live ))"]; var liveFeedText = ["Live", "((Live))", "(( Live ))", "((&nbsp; Live &nbsp;))"];
var liveFeedRoll = 0; var liveFeedRoll = 0;
function onPlaying() function onPlaying()
...@@ -857,6 +867,7 @@ function onStop() ...@@ -857,6 +867,7 @@ function onStop()
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";
setSeekable(false);
} }
function onError() function onError()
......
...@@ -172,6 +172,12 @@ function handle_MediaPlayerTimeChanged(time) ...@@ -172,6 +172,12 @@ function handle_MediaPlayerTimeChanged(time)
// seekable media // seekable media
info.innerHTML = formatTime(time)+"/"+formatTime(mediaLen); info.innerHTML = formatTime(time)+"/"+formatTime(mediaLen);
} }
else
{
// non-seekable "live" media
liveFeedRoll = liveFeedRoll & 3;
info.innerHTML = liveFeedText[liveFeedRoll++];
}
} }
} }
...@@ -430,6 +436,8 @@ function onOpen() ...@@ -430,6 +436,8 @@ function onOpen()
{ {
document.getElementById("state").innerHTML = "Opening..."; document.getElementById("state").innerHTML = "Opening...";
document.getElementById("PlayOrPause").value = "Pause"; document.getElementById("PlayOrPause").value = "Pause";
if( liveFeedRoll != 0 )
liveFeedRoll = 0;
} }
function onBuffer() function onBuffer()
...@@ -450,7 +458,7 @@ function onEnd() ...@@ -450,7 +458,7 @@ function onEnd()
document.getElementById("state").innerHTML = "End..."; document.getElementById("state").innerHTML = "End...";
} }
var liveFeedText = ["Live", "((Live))", "(( Live ))", "(( Live ))"]; var liveFeedText = ["Live", "((Live))", "(( Live ))", "((&nbsp; Live &nbsp;))"];
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