[vlc-devel] [PATCH 07/17] test pages: show current state after buffering

Daniel Amm da2424 at t-online.de
Sun Jun 14 00:35:43 CEST 2015


---
 share/test/test.html       | 11 +++++++++++
 share/test/windowless.html | 11 +++++++++++
 2 files changed, 22 insertions(+)

diff --git a/share/test/test.html b/share/test/test.html
index 116fe22..56af9b5 100755
--- a/share/test/test.html
+++ b/share/test/test.html
@@ -107,7 +107,18 @@ function handle_MediaPlayerOpening()
 
 function handle_MediaPlayerBuffering(val)
 {
+    var vlc = getVLC("vlc");
+
     document.getElementById("info").innerHTML = val + "%";
+
+    if( vlc && val == 100 )
+    {
+        // display the current state after buffering
+        if( vlc.playlist.isPlaying )
+            onPlay();
+        else
+            onPause();
+    }
 }
 
 function handle_MediaPlayerPlaying()
diff --git a/share/test/windowless.html b/share/test/windowless.html
index 32d69da..ea5dd2f 100755
--- a/share/test/windowless.html
+++ b/share/test/windowless.html
@@ -111,7 +111,18 @@ function handle_MediaPlayerOpening()
 
 function handle_MediaPlayerBuffering(val)
 {
+    var vlc = getVLC("vlc");
+
     document.getElementById("info").innerHTML = val + "%";
+
+    if( vlc && val == 100 )
+    {
+        // display the current state after buffering
+        if( vlc.playlist.isPlaying )
+            onPlay();
+        else
+            onPause();
+    }
 }
 
 function handle_MediaPlayerPlaying()
-- 
2.1.4




More information about the vlc-devel mailing list