Commit da9e9a60 authored by Akash Mehrotra's avatar Akash Mehrotra Committed by Rémi Denis-Courmont

Added Force pause, force resume Updated pl_pause to behave as in oldhttp

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent cbad172f
...@@ -26,9 +26,15 @@ status.xml: ...@@ -26,9 +26,15 @@ status.xml:
> play playlist item <id>. If <id> is omitted, play last active item: > play playlist item <id>. If <id> is omitted, play last active item:
?command=pl_play&id=<id> ?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> ?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: > stop playback:
?command=pl_stop ?command=pl_stop
......
...@@ -59,7 +59,23 @@ elseif command == "pl_play" then ...@@ -59,7 +59,23 @@ elseif command == "pl_play" then
vlc.playlist.goto(id) vlc.playlist.goto(id)
end end
elseif command == "pl_pause" then elseif command == "pl_pause" then
if vlc.playlist.status() == "stopped" then
if id == -1 then
vlc.playlist.play()
else
vlc.playlist.goto(id)
end
else
vlc.playlist.pause() 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 elseif command == "pl_stop" then
vlc.playlist.stop() vlc.playlist.stop()
elseif command == "pl_next" then elseif command == "pl_next" then
......
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