[vlc-commits] Added Force pause, force resume Updated pl_pause to behave as in oldhttp
Akash Mehrotra
git at videolan.org
Sun May 1 11:52:03 CEST 2011
vlc | branch: master | Akash Mehrotra <mehrotra.akash at gmail.com> | Sun Apr 24 15:19:01 2011 +0530| [da9e9a607cc1f2a4d262f4c480232ef538df6a7a] | committer: Rémi Denis-Courmont
Added Force pause, force resume Updated pl_pause to behave as in oldhttp
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=da9e9a607cc1f2a4d262f4c480232ef538df6a7a
---
share/lua/http/requests/README.txt | 8 +++++++-
share/lua/http/requests/status.xml | 18 +++++++++++++++++-
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/share/lua/http/requests/README.txt b/share/lua/http/requests/README.txt
index c287acf..f3a7667 100644
--- a/share/lua/http/requests/README.txt
+++ b/share/lua/http/requests/README.txt
@@ -26,9 +26,15 @@ status.xml:
> play playlist item <id>. If <id> is omitted, play last active item:
?command=pl_play&id=<id>
-> toggle pause. If current state was 'stop', play item <id>:
+> toggle pause. If current state was 'stop', play item <id>, if no <id> specified, play current item. If no current item, play 1st item in the playlist:
?command=pl_pause&id=<id>
+> resume playback if paused, else do nothing
+ ?command=pl_forceresume
+
+> pause playback, do nothing if already paused
+ ?command=pl_forcepause
+
> stop playback:
?command=pl_stop
diff --git a/share/lua/http/requests/status.xml b/share/lua/http/requests/status.xml
index 944cf09..bbef12d 100644
--- a/share/lua/http/requests/status.xml
+++ b/share/lua/http/requests/status.xml
@@ -59,7 +59,23 @@ elseif command == "pl_play" then
vlc.playlist.goto(id)
end
elseif command == "pl_pause" then
- vlc.playlist.pause()
+ if vlc.playlist.status() == "stopped" then
+ if id == -1 then
+ vlc.playlist.play()
+ else
+ vlc.playlist.goto(id)
+ end
+ else
+ vlc.playlist.pause()
+ end
+elseif command == "pl_forcepause" then
+ if vlc.playlist.status() == "playing" then
+ vlc.playlist.pause()
+ end
+elseif command == "pl_forceresume" then
+ if vlc.playlist.status() == "paused" then
+ vlc.playlist.pause()
+ end
elseif command == "pl_stop" then
vlc.playlist.stop()
elseif command == "pl_next" then
More information about the vlc-commits
mailing list