stp atric ks.fin alsite .com
$(".video-advanced").on("click", ".fsMediaContainer", function() {
if(!$(this).hasClass("once")) {
$(this).addClass("once");
$('<div class="video-lightbox"><button class="fsCloseVideoBtn"></button></div>').prependTo(".video-advanced");
$(this).parents(".video-advanced").addClass("playing");
$(this).appendTo($(this).parents(".video-advanced").find(".video-lightbox"));
$(this).find("video").get(0).play();
$(this).find('video').get(0).onended=function(e) {
alert("asdf");
};
}
Orange section…click the video.
I’m getting a console error
undefined:1 Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().
I’m not getting much out of Google on my searches. Can someone explain what the issue is?
I tried moving that onended function into a set interval which tried to eventually find the lightbox element video once made, and then run the onended, but I kept getting console errors there…so I went this approach.How should I handle this? The lightbox is made dynamically and the video is appended there and plays. On video finishing, I plan on doing some stuff.