Adding JS event listeners using Javascript trigger Feb 09, 2023 By John B 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?
Walt Hamilton Hero 1 year ago02/10/23 at 12:48 am (UTC) 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.
John B Author Walt Hamilton 1 year ago02/10/23 at 4:32 pm (UTC) No, the video is not in Storyline. And my question is more of a general question about applying eventlisterners
2 Replies
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.
No, the video is not in Storyline. And my question is more of a general question about applying eventlisterners