View Full Version : End of Movie Transition

16 Nov 2011, 9:08 PM
Hi Guys

How can i initiate a transition to another scene when ever a video ends playing? is there a way to catch that?


17 Nov 2011, 9:31 AM
I haven't tried this myself, but this might work:

You can set a start action for the scene with the video to custom js.
Give the video a css id (e.g. "funVideo")

then you can do something like this in for the start action js

//not tested code
var video = document.querySelector("#funVideo video");

//psudo code
if we haven't set up the listener before
attach event listener for "ended" to the video element
callback function:

17 Nov 2011, 3:00 PM
Thanks arnebech

I do have a problem with the video Auto play, once i select the auto play on the video it start from the beginning of the site even though the video is the last scene. How can i target the video play through code? same approach as targeting the end? does it need a listener?


17 Nov 2011, 3:17 PM
Again, this is untested, but here is my best guess.

Turn off auto play.
In the custom js start action I talked about in my previous post, you could do something like this:

var video = ... //same as previous code


17 Nov 2011, 4:14 PM
Thanks arne :)


20 Nov 2011, 7:08 PM
Hi Arne

Adding the event listener is giving me an "'undefined' is not a function" error! any idea how to solve this.

actually the querySelector gives a NULL when adding the event listener, and getElement gives an UNDEFINED!


21 Nov 2011, 10:10 AM
Are you giving the video element a css id?


//this should work as a start action for the scene
var video = document.querySelector("#funVideo video");

21 Nov 2011, 2:21 PM
Hi ArneThanks for the help, the video worked last night, i tested the same approach on the audio first and when it didn't work i thought the same holds true for the video, but the video part worked.question, do you offer and paid support options for Sencha Animate?

21 Nov 2011, 2:24 PM
No, we don't offer regular paid support at this point. However, we try to respond to forum questions.

21 Nov 2011, 2:28 PM
I understand, problem for us is that we're at the other part of the earth (Australia) and the time differento get a responce is not on our favor. Thanks