[vlc-devel] [PATCH 08/17] test pages: fix live media animation
Daniel Amm
da2424 at t-online.de
Sun Jun 14 00:35:44 CEST 2015
---
share/test/test.html | 17 ++++++++++++++---
share/test/windowless.html | 10 +++++++++-
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/share/test/test.html b/share/test/test.html
index 56af9b5..920d93d 100755
--- a/share/test/test.html
+++ b/share/test/test.html
@@ -168,6 +168,12 @@ function handle_MediaPlayerTimeChanged(time)
// seekable media
info.innerHTML = formatTime(time)+"/"+formatTime(mediaLen);
}
+ else
+ {
+ // non-seekable "live" media
+ liveFeedRoll = liveFeedRoll & 3;
+ info.innerHTML = liveFeedText[liveFeedRoll++];
+ }
}
}
@@ -456,8 +462,8 @@ function close()
<!--
var telxState = false;
-var canPause = true;
-var canSeek = true;
+var canPause = false;
+var canSeek = false;
function setPauseable(val)
{
@@ -467,6 +473,8 @@ function setPauseable(val)
function setSeekable(val)
{
canSeek = val;
+ if( liveFeedRoll != 0 )
+ liveFeedRoll = 0;
}
function doSetSlider()
@@ -802,6 +810,7 @@ function onOpen()
{
document.getElementById("state").innerHTML = "Opening...";
document.getElementById("PlayOrPause").value = "Pause";
+ setSeekable(false);
}
function onBuffer()
@@ -820,9 +829,10 @@ function onPlay()
function onEnd()
{
document.getElementById("state").innerHTML = "End...";
+ setSeekable(false);
}
-var liveFeedText = ["Live", "((Live))", "(( Live ))", "(( Live ))"];
+var liveFeedText = ["Live", "((Live))", "(( Live ))", "(( Live ))"];
var liveFeedRoll = 0;
function onPlaying()
@@ -857,6 +867,7 @@ function onStop()
document.getElementById("info").innerHTML = "-:--:--/-:--:--";
document.getElementById("state").innerHTML = "Stopped...";
document.getElementById("PlayOrPause").value = "Play";
+ setSeekable(false);
}
function onError()
diff --git a/share/test/windowless.html b/share/test/windowless.html
index ea5dd2f..c464cda 100755
--- a/share/test/windowless.html
+++ b/share/test/windowless.html
@@ -172,6 +172,12 @@ function handle_MediaPlayerTimeChanged(time)
// seekable media
info.innerHTML = formatTime(time)+"/"+formatTime(mediaLen);
}
+ else
+ {
+ // non-seekable "live" media
+ liveFeedRoll = liveFeedRoll & 3;
+ info.innerHTML = liveFeedText[liveFeedRoll++];
+ }
}
}
@@ -430,6 +436,8 @@ function onOpen()
{
document.getElementById("state").innerHTML = "Opening...";
document.getElementById("PlayOrPause").value = "Pause";
+ if( liveFeedRoll != 0 )
+ liveFeedRoll = 0;
}
function onBuffer()
@@ -450,7 +458,7 @@ function onEnd()
document.getElementById("state").innerHTML = "End...";
}
-var liveFeedText = ["Live", "((Live))", "(( Live ))", "(( Live ))"];
+var liveFeedText = ["Live", "((Live))", "(( Live ))", "(( Live ))"];
var liveFeedRoll = 0;
function onPlaying()
--
2.1.4
More information about the vlc-devel
mailing list