Implement "current" command, see #7.

develop
Icedream 2015-11-05 18:40:49 +01:00
parent 003ec48763
commit e8da814e59
1 changed files with 9 additions and 0 deletions

View File

@ -186,6 +186,15 @@ ts3clientService.on "started", (ts3proc) =>
params = []
switch name.toLowerCase()
when "current"
item = vlc.playlist.items[vlc.playlist.currentItem]
info = vlcMediaInfo[item.mrl]
url = info?.originalUrl or item.mrl
title = info?.title or item.mrl
ts3query?.sendtextmessage 2, 0, "Currently playing [URL=#{url}]#{title}[/URL]."
# Restore audio volume
vlc.audio.volume = vlcVolume
when "pause"
# now we can toggle-pause playback this easily! yay!
vlc.togglePause()