[vlc-commits] web intf: fix reading position from status.xml

Francois Cartegnie git at videolan.org
Thu Sep 22 00:17:47 CEST 2011


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Sep 22 00:09:22 2011 +0200| [3fa047734ac771471d75c2972dfe21e72936c8d0] | committer: Francois Cartegnie

web intf: fix reading position from status.xml

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

 share/lua/http/js/common.js     |    4 ++++
 share/lua/http/js/controlers.js |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/share/lua/http/js/common.js b/share/lua/http/js/common.js
index 483a595..9c0ad50 100644
--- a/share/lua/http/js/common.js
+++ b/share/lua/http/js/common.js
@@ -12,6 +12,10 @@ function format_time( s ){
 	seconds		=	seconds<10 ? "0"+seconds : seconds;
     return hours+":"+minutes+":"+seconds;
 }
+function toFloat(text)
+{
+	return parseFloat(text.replace(',','.'));
+}
 function setIntv(){
 	if(intv>0){
 		intv++;
diff --git a/share/lua/http/js/controlers.js b/share/lua/http/js/controlers.js
index a025d49..30c143e 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: ($('position',data).text()*100) });
+				$('#seekSlider').slider({value: toFloat($('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()) });



More information about the vlc-commits mailing list