

I wanted a ‘next’ button to appear AFTER an event video finished playing. There might be a way of achieving this with the timeline, but I thought this method worked better.
1. Create a ‘next’ button and ID name it ‘nextBtn’.
2. Hide the button (press the eyeball)
3. Import your event video onto the frame (name does not matter)
4. Execute Javascript on the frame
5. Enter in the following code:
document.getElementsByTagName(“video”)[0].addEventListener(‘ended’,yourFunction,false);
function yourFunction(e) {
cp.show(“nextBtn”);
}
6. Watch and enjoy
Notes
You can add lots of other stuff to this trigger. I update variables so that the LMS will store and ‘remember’ if a user watched the video or not. I also have a little check mark icon show next to the video.
If you have more than one video on the same frame, you change the array number. Example – document.getElementsByTagName(“video”)[1]
It depends on which video you load onto the frame first.
Hope this will be helpful to someone.
I wanted a ‘next’ button to appear AFTER an event video finished playing. There might be a way of achieving this with the timeline, but I thought this method worked better.
1. Create a ‘next’ button and ID name it ‘nextBtn’.
2. Hide the button (press the eyeball)
3. Import your event video onto the frame (name does not matter)
4. Execute Javascript on the frame
5. Enter in the following code:
document.getElementsByTagName(“video”)[0].addEventListener(‘ended’,yourFunction,false);
function yourFunction(e) {
cp.show(“nextBtn”);
}
6. Watch and enjoy
Notes
You can add lots of other stuff to this trigger. I update variables so that the LMS will store and ‘remember’ if a user watched the video or not. I also have a little check mark icon show next to the video.
If you have more than one video on the same frame, you change the array number. Example – document.getElementsByTagName(“video”)[1]
It depends on which video you load onto the frame first.
Hope this will be helpful to someone.
You must be logged in to post a comment.

- Most Recent
- Most Relevant
Cannot for the life of me get this to work. Using sync video as well. It won’t trigger anything I put in the function for the ended listen event including the following:
document.getElementsByTagName(“video”)[0].addEventListener(‘ended’,yourFunction,false);
function yourFunction(e) {
alert (“Hello”);
}
Hi Jeremy, I have just tried this for my event video, however this doesn’t seem to be working for me. Do I need to change any of the code? And am I executing the javascript on the slide on enter (this is what I have done currently and the button shows instantly rather than when the video has ended) ?