(note that you can use a triple tick ` to begin and end code blocks - makes it easier to read and won’t get reformatted by the forums)
This method only works with the HTML5 <video>
tag; vimeo videos are embedded in an iframe and use a separate API. The method that you are using (I assume from this post) will stop the vimeo video by basically removing it entirely. This is probably only appropriate on a scene change where it is okay if it goes blank but will be re-recreated when revisiting the scene. If that’s the desired behavior you want, then I’d recommend @DBear’s original method to get the element. What you’d do is assign a class name ("your-class
") to the Hype Element that contains the vimeo video. Then you can blank out the inner HTML. It’d look something like:
var videos = document.querySelectorAll(".your-class");
videos.forEach(function(video){
if(video.pause) {
video.pause();
// video.currentTime =0; // if you want to go back to beginning
} else {
video.innerHTML = "";
}
});