[vlc-commits] luaHTTP: behave like oldHTTP for seeking

Jean-Baptiste Kempf git at videolan.org
Sun Sep 18 11:13:17 CEST 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Sep 18 11:12:02 2011 +0200| [a0d300293418d23286b7b24658de4cae99bd87d2] | committer: Jean-Baptiste Kempf

luaHTTP: behave like oldHTTP for seeking

Close #5345
Patch by jikuja

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

 share/lua/http/js/controlers.js |    2 +-
 share/lua/http/js/ui.js         |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/share/lua/http/js/controlers.js b/share/lua/http/js/controlers.js
index bc969b7..ba2315b 100644
--- a/share/lua/http/js/controlers.js
+++ b/share/lua/http/js/controlers.js
@@ -10,7 +10,7 @@ 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: ($('time',data).text()/$('length',data).text()*100) })
+				$('#seekSlider').slider({value: ($('position',data).text()*100) });
 				$('#currentVolume').append(Math.round($('volume',data).text()/5.12)+'%');
 				$('#volumeSlider').slider({value: ($('volume',data).text()/5.12) });
 				$('#rateSlider').slider({value: ($('rate',data).text()) });
diff --git a/share/lua/http/js/ui.js b/share/lua/http/js/ui.js
index fbef9ff..5bce915 100644
--- a/share/lua/http/js/ui.js
+++ b/share/lua/http/js/ui.js
@@ -8,7 +8,7 @@ $(function(){
 			$( "#currentTime" ).empty().append( format_time(Math.round((ui.value/100)*$('#seekSlider').attr('totalLength'))) );
 			switch(current_que){
 				case 'main':
-					sendCommand({'command':'seek','val':Math.round((ui.value/100)*$('#seekSlider').attr('totalLength'))});
+					sendCommand({'command':'seek','val':(ui.value)+'%'});
 					break;
 				case 'stream':
 					sendVLMCmd('control Current seek '+ui.value);
@@ -69,4 +69,4 @@ $(function(){
 		return false;
 	});
 	$('#stream_host').val(stream_server);
-})
\ No newline at end of file
+})



More information about the vlc-commits mailing list