Forum Discussion
JohnBowyer-Smyt
3 years agoCommunity Member
Adding JS event listeners using Javascript trigger
I have tried several times to add Javascript event listeners using the Javascript trigger in Storyline but they never seem to work. Eg.
var video = document.querySelector("video");
video.addEventListener("ended", function() {
alert("ended");
});
Has anyone had luck with this?
- WaltHamiltonSuper Hero
If the video is in SL, there is a built-in "when media ends" trigger. If it is just linked media, I'm not sure you can find its end.
- JohnBowyer-SmytCommunity Member
No, the video is not in Storyline. And my question is more of a general question about applying eventlisterners