[vlc-commits] test pages: fix live media animation

Daniel Amm git at videolan.org
Sun Jun 14 00:58:26 CEST 2015


npapi-vlc | branch: master | Daniel Amm <da2424 at t-online.de> | Sun Jun 14 00:35:44 2015 +0200| [a1f445c369834df1da742edf3693fd684927f8c1] | committer: Jean-Baptiste Kempf

test pages: fix live media animation

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=a1f445c369834df1da742edf3693fd684927f8c1
---

 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 100644
--- 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 100644
--- 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()



More information about the vlc-commits mailing list