-
1. Re: How can I detect end of HTML5 video and do something?
Aubrey Scarza Aug 21, 2014 3:52 AM (in response to denfloj)Try adding the following underneath your existing code. Let me know if it works
var vidEnd = $(vid).children().first();
$(vidEnd).bind('ended', function ()
{
//do stuff here
});
-
2. Re: How can I detect end of HTML5 video and do something?
thirdd3 Aug 21, 2014 11:35 AM (in response to Aubrey Scarza)Do you add this to the Stage code? If I want to hide the video what would that code look like.
(very very very very new to all this)
-
3. Re: How can I detect end of HTML5 video and do something?
Aubrey Scarza Aug 22, 2014 3:10 AM (in response to thirdd3)I have this in a trigger on the stage timeline, you could have all of this code in the one trigger, or in composition ready, or in creation complete... depends when you want the video to play I suppose?
To hide the video you could just use .hide();
My code looks like this;
var vid = sym.$('rectangle_video_housing');
vid.html('<video style="width:900px;height:500px;" controls autoplay><source src="http://www.website.co.uk/video.mp4"></video>');var vidEnd = $(vid).children().first();
$(vidEnd).bind('ended', function ()
{
vid.hide();
}); -
4. Re: How can I detect end of HTML5 video and do something?
denfloj Aug 22, 2014 7:48 AM (in response to Aubrey Scarza)Thanks for all the help. These are all great knowledge.
I would like to open up a lightbox or fancy box when the video ends. Hopefully you guys can help me on this.

