Uncaught TypeError $(...)[0] is undefined when playing mp4
Good morning!
I work with Adobe Animate CC 23 and just want to play a video with my own buttons. Some years ago I already did it but now my code always gives errors. My project will be published as html5 canvas. This time I want to keep my project simple without mouseover or mouseout.
When my play Button is clicked function playVideo will be called and produces the error
Uncaught TypeError $(...)[0] is undefined
step1 is the instance name of my video. I do not have any idea what is wrong with my code.
Any idea would be appreciated. Thank's in advance.
$("#dom_overlay_container").on("click","#PLAYBUTTONout",playVideo.bind(this));
$("#dom_overlay_container").on("click","#PLAYBUTTONpressed",videoPause.bind(this));
$("#dom_overlay_container").on("click","#STOPBUTTONout",videoEnde.bind(this));
function playVideo(evt)
{
$("#PLAYBUTTONout")[0].style.display = "none";
$("#PLAYBUTTONpressed")[0].style.display = "block";
$("#step1")[0].style.display = "block";
$("#step1")[0].play();
$("#step1")[0].addEventListener("ended",videoEnde,false);
}
