Page 1 of 1

OnVideoEnd

Posted: Mon Feb 27, 2012 10:46 pm
by djrikki
Cannot seem to get this to work, I implement it in the same way I would do with CloseWindow, but the function is never called.

Code: Select all

Function filemanager:CloseVideo()
        DebugPrint("Hey why isn't this function being called automatically when the video ends!")
	CloseVideo(1)
	videosize = 2
	tunevolume = 100
	CtrlCQuit(True)
	base:CloseDisplay(#VIDEOWINDOW)
	ShowPointer()
	Calendar:SwitchBack()
EndFunction

Function filemanager_CloseVideo() filemanager:CloseVideo() EndFunction

Global filemanager
filemanager = {}
; Just wrote this to be prove I am declaring object functions correctly...  ESCape key via OnKeyDown and Close gadget via filemanager_CloseVideo both
; work, but OnVideoEnd won't even call the function.

InstallEventHandler({OnVideoEnd = filemanager_CloseVideo, CloseWindow = filemanager_CloseVideo, OnKeyDown = Keyboard_Video, OnMouseMove = Toolbar_Video})

Re: OnVideoEnd

Posted: Fri Mar 02, 2012 12:51 pm
by airsoftsoftwair
The bug must be in your code, not in Hollywood. Are you using a WaitEvent() loop? The following works fine here:

Code: Select all

OpenVideo(1, ...)
InstallEventHandler({OnVideoEnd = Function(msg) DebugPrint("End") EndFunction})
PlayVideo(1)
Repeat
  WaitEvent
Forever