mirror of https://github.com/icedream/ts3bot.git
VLC event members are actually properties, not functions.
Got the documentation wrong here, I was looking up examples and it looked as if calling the on* fields as functions was the right way to go but it was actually not. 64bf4ffc36/src/JsVlcPlayer.cpp (L90-L102)
clearly defines as set-properties here.
develop
parent
e923f80333
commit
852052388d
14
app.iced
14
app.iced
|
@ -64,15 +64,15 @@ ts3clientService.on "started", (ts3proc) =>
|
||||||
ts3query = ts3clientService.query
|
ts3query = ts3clientService.query
|
||||||
|
|
||||||
# VLC event handling
|
# VLC event handling
|
||||||
vlc.onPlaying () =>
|
vlc.onPlaying = () =>
|
||||||
info = vlcMediaInfo[vlc.playlist.items[vlc.playlist.currentItem].mrl]
|
info = vlcMediaInfo[vlc.playlist.items[vlc.playlist.currentItem].mrl]
|
||||||
ts3query.sendtextmessage 2, 0, "Now playing [URL=#{info.originalUrl}]#{info.title}[/URL]."
|
ts3query.sendtextmessage 2, 0, "Now playing [URL=#{info.originalUrl}]#{info.title}[/URL]."
|
||||||
vlc.onPaused () => ts3query.sendtextmessage 2, 0, "Paused."
|
vlc.onPaused = () => ts3query.sendtextmessage 2, 0, "Paused."
|
||||||
vlc.onForward () => ts3query.sendtextmessage 2, 0, "Fast-forwarding..."
|
vlc.onForward = () => ts3query.sendtextmessage 2, 0, "Fast-forwarding..."
|
||||||
vlc.onBackward () => ts3query.sendtextmessage 2, 0, "Rewinding..."
|
vlc.onBackward = () => ts3query.sendtextmessage 2, 0, "Rewinding..."
|
||||||
vlc.onEncounteredError () => log.error "VLC has encountered an error! You will need to restart the bot.", arguments
|
vlc.onEncounteredError = () => log.error "VLC has encountered an error! You will need to restart the bot.", arguments
|
||||||
vlc.onEndReached () => ts3query.sendtextmessage 2, 0, "End of playlist reached."
|
vlc.onEndReached = () => ts3query.sendtextmessage 2, 0, "End of playlist reached."
|
||||||
vlc.onStopped () => ts3query.sendtextmessage 2, 0, "Stopped."
|
vlc.onStopped = () => ts3query.sendtextmessage 2, 0, "Stopped."
|
||||||
|
|
||||||
ts3query.currentScHandlerID = 1
|
ts3query.currentScHandlerID = 1
|
||||||
ts3query.mydata = {}
|
ts3query.mydata = {}
|
||||||
|
|
Loading…
Reference in New Issue