From 852052388df2c469e26a9455d5fd21f5db78c065 Mon Sep 17 00:00:00 2001 From: icedream Date: Tue, 27 Oct 2015 22:40:39 +0100 Subject: [PATCH] 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. https://github.com/RSATom/WebChimera.js/blob/64bf4ffc362898e309c8a444c8888ad7b4bfae92/src/JsVlcPlayer.cpp#L90-L102 clearly defines as set-properties here. --- app.iced | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app.iced b/app.iced index 7c48de4..21826f9 100644 --- a/app.iced +++ b/app.iced @@ -64,15 +64,15 @@ ts3clientService.on "started", (ts3proc) => ts3query = ts3clientService.query # VLC event handling - vlc.onPlaying () => + vlc.onPlaying = () => info = vlcMediaInfo[vlc.playlist.items[vlc.playlist.currentItem].mrl] ts3query.sendtextmessage 2, 0, "Now playing [URL=#{info.originalUrl}]#{info.title}[/URL]." - vlc.onPaused () => ts3query.sendtextmessage 2, 0, "Paused." - vlc.onForward () => ts3query.sendtextmessage 2, 0, "Fast-forwarding..." - 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.onEndReached () => ts3query.sendtextmessage 2, 0, "End of playlist reached." - vlc.onStopped () => ts3query.sendtextmessage 2, 0, "Stopped." + vlc.onPaused = () => ts3query.sendtextmessage 2, 0, "Paused." + vlc.onForward = () => ts3query.sendtextmessage 2, 0, "Fast-forwarding..." + 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.onEndReached = () => ts3query.sendtextmessage 2, 0, "End of playlist reached." + vlc.onStopped = () => ts3query.sendtextmessage 2, 0, "Stopped." ts3query.currentScHandlerID = 1 ts3query.mydata = {}