Commit 4763a6a2 authored by Edward Wang's avatar Edward Wang Committed by Jean-Baptiste Kempf

luahttp: Don't interfere with seek slider either

Ref #6652
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent e91edd90
...@@ -17,9 +17,11 @@ function updateStatus() { ...@@ -17,9 +17,11 @@ function updateStatus() {
$('#mediaTitle').append($('[name="filename"]', data).text()); $('#mediaTitle').append($('[name="filename"]', data).text());
$('#totalTime').append(format_time($('length', data).text())); $('#totalTime').append(format_time($('length', data).text()));
$('#currentTime').append(format_time($('time', data).text())); $('#currentTime').append(format_time($('time', data).text()));
$('#seekSlider').slider({ if (!$('#seekSlider').data('clicked')) {
value: toFloat($('position', data).text()) * 100 $('#seekSlider').slider({
}); value: toFloat($('position', data).text()) * 100
});
}
$('#currentVolume').append(Math.round($('volume', data).text() / 2.56) + '%'); $('#currentVolume').append(Math.round($('volume', data).text() / 2.56) + '%');
/* Don't interfere with the user's action */ /* Don't interfere with the user's action */
if (!$('#volumeSlider').data('clicked')) { if (!$('#volumeSlider').data('clicked')) {
......
...@@ -4,6 +4,9 @@ $(function () { ...@@ -4,6 +4,9 @@ $(function () {
value: 0, value: 0,
min: 0, min: 0,
max: 100, max: 100,
start: function (event, ui) {
$("#seekSlider").data( 'clicked', true );
},
stop: function (event, ui) { stop: function (event, ui) {
$("#currentTime").empty().append(format_time(Math.round((ui.value / 100) * $('#seekSlider').attr('totalLength')))); $("#currentTime").empty().append(format_time(Math.round((ui.value / 100) * $('#seekSlider').attr('totalLength'))));
switch (current_que) { switch (current_que) {
...@@ -17,6 +20,7 @@ $(function () { ...@@ -17,6 +20,7 @@ $(function () {
sendVLMCmd('control Current seek ' + ui.value); sendVLMCmd('control Current seek ' + ui.value);
break; break;
} }
$("#seekSlider").data( 'clicked', false );
} }
}); });
$("#volumeSlider").slider({ $("#volumeSlider").slider({
...@@ -36,8 +40,9 @@ $(function () { ...@@ -36,8 +40,9 @@ $(function () {
$("#volumeSlider").data( 'clicked', false ); $("#volumeSlider").data( 'clicked', false );
} }
}); });
/* To ensure that updateStatus() doesn't interfere while use is /* To ensure that updateStatus() doesn't interfere while the user
* sliding on the control. */ * slides the controls. */
$("#seekSlider").data( 'clicked', false );
$("#volumeSlider").data( 'clicked', false ); $("#volumeSlider").data( 'clicked', false );
$('#buttonStop').click(function () { $('#buttonStop').click(function () {
switch (current_que) { switch (current_que) {
......
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