From: Antoine Cellerier Date: Wed, 15 Mar 2006 13:01:36 +0000 (+0000) Subject: "[PATCH] http interface workaround to make the play/pause button work well" by Lauren... X-Git-Tag: 0.9.0-test0~11900 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=c0fe636d8e26a88ae46bd98fb15e1282d7593236;p=vlc "[PATCH] http interface workaround to make the play/pause button work well" by Laurent Mutricy. --- diff --git a/THANKS b/THANKS index e566451bb5..07c0afc302 100644 --- a/THANKS +++ b/THANKS @@ -78,6 +78,7 @@ Jonas Larsen - Danish translation Julien Blache - disc ejection code kty0ne - WinAmp 5 skin for VLC Laurent Jonqueres - Occitan localization +Laurent Mutricy - HTTP interface fixes Lorena Gomes - Catalan translation Marc Nolette - PVR support in DirectShow input Marco Munderloh - HTTP fix for Win32 to URL filenames diff --git a/share/http/js/functions.js b/share/http/js/functions.js index 2304c1ba7c..7b694db78a 100644 --- a/share/http/js/functions.js +++ b/share/http/js/functions.js @@ -21,9 +21,12 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -/* global variables */ +/********************************************************************** + * Global variables + *********************************************************************/ var old_time = 0; +var pl_cur_id; /********************************************************************** * Slider functions @@ -273,11 +276,12 @@ function in_enqueue() function pl_play( id ) { loadXMLDoc( 'requests/status.xml?command=pl_play&id='+id, parse_status ); + pl_cur_id = id; setTimeout( 'update_playlist()', 1000 ); } function pl_pause() { - loadXMLDoc( 'requests/status.xml?command=pl_pause', parse_status ); + loadXMLDoc( 'requests/status.xml?command=pl_pause&id='+pl_cur_id, parse_status ); } function pl_stop() { @@ -478,6 +482,9 @@ function parse_playlist() var pos = document.createElement( "div" ); var pos_top = pos; var elt = answer.firstChild; + + pl_cur_id = 0; /* changed to the current id is there actually + * is a current id */ while( elt ) { if( elt.nodeName == "node" ) @@ -513,6 +520,7 @@ function parse_playlist() clear_children( nowplaying ); nowplaying.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) ); pl.appendChild( document.createTextNode( '* ')); + pl_cur_id = elt.getAttribute( 'id' ); } pl.setAttribute( 'title', elt.getAttribute( 'uri' )); pl.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) ); diff --git a/share/http/requests/status.xml b/share/http/requests/status.xml index d92bd64ab4..334b6d14dc 100644 --- a/share/http/requests/status.xml +++ b/share/http/requests/status.xml @@ -42,7 +42,11 @@ - + + + + +