[vlc-commits] luahttp: Don't interfere with seek slider either

Edward Wang git at videolan.org
Fri May 25 00:44:47 CEST 2012


vlc/vlc-2.0 | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Thu May 24 18:30:50 2012 -0400| [d9ca6136b67011f6807c093d46ac9ccc04849090] | committer: Jean-Baptiste Kempf

luahttp: Don't interfere with seek slider either

Ref #6652

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 4763a6a249a3280abe346b67238e8f9861a5999f)

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

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

 share/lua/http/js/controlers.js |    8 +++++---
 share/lua/http/js/ui.js         |    9 +++++++--
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/share/lua/http/js/controlers.js b/share/lua/http/js/controlers.js
index c80be38..6ef5782 100644
--- a/share/lua/http/js/controlers.js
+++ b/share/lua/http/js/controlers.js
@@ -17,9 +17,11 @@ function updateStatus() {
                 $('#mediaTitle').append($('[name="filename"]', data).text());
                 $('#totalTime').append(format_time($('length', data).text()));
                 $('#currentTime').append(format_time($('time', data).text()));
-                $('#seekSlider').slider({
-                    value: toFloat($('position', data).text()) * 100
-                });
+                if (!$('#seekSlider').data('clicked')) {
+                    $('#seekSlider').slider({
+                        value: toFloat($('position', data).text()) * 100
+                    });
+                }
                 $('#currentVolume').append(Math.round($('volume', data).text() / 2.56) + '%');
                 /* Don't interfere with the user's action */
                 if (!$('#volumeSlider').data('clicked')) {
diff --git a/share/lua/http/js/ui.js b/share/lua/http/js/ui.js
index 489e4fb..ec39211 100644
--- a/share/lua/http/js/ui.js
+++ b/share/lua/http/js/ui.js
@@ -4,6 +4,9 @@ $(function () {
         value: 0,
         min: 0,
         max: 100,
+        start: function (event, ui) {
+            $("#seekSlider").data( 'clicked', true );
+        },
         stop: function (event, ui) {
             $("#currentTime").empty().append(format_time(Math.round((ui.value / 100) * $('#seekSlider').attr('totalLength'))));
             switch (current_que) {
@@ -17,6 +20,7 @@ $(function () {
                 sendVLMCmd('control Current seek ' + ui.value);
                 break;
             }
+            $("#seekSlider").data( 'clicked', false );
         }
     });
     $("#volumeSlider").slider({
@@ -36,8 +40,9 @@ $(function () {
             $("#volumeSlider").data( 'clicked', false );
         }
     });
-    /* To ensure that updateStatus() doesn't interfere while use is
-     * sliding on the control. */
+    /* To ensure that updateStatus() doesn't interfere while the user
+     * slides the controls. */
+    $("#seekSlider").data( 'clicked', false );
     $("#volumeSlider").data( 'clicked', false );
     $('#buttonStop').click(function () {
         switch (current_que) {



More information about the vlc-commits mailing list