html5 canvas plays video just once
- May 12, 2023
- 1 reply
- 301 views
I am creating a html5 canvas project with Animate CC 23.0. Frame 5 of my project displays a schematically description of a tanker. Some parts of that schema are clickable for a description accept one (Picture 1). This one (yellow marked) jumps to Frame 6 with a video component, a blue background for the descriptional text and a Play Button (Picture 2) . The video file (mp4) can be started, stopped, started as long as one want.
Going back to Frame 5 and enters Frame 6 again you can see on Picture 3 no video component, no blue background, no Button.
I tried it just with component controls ( just with this.stop() on Frame 6), with the code from the components and different other structures. Always the same. First visit it plays second visit it's gone.
When using scripts like
function playVideo()
{
$("#FWA")[0].play();
$("#FWA")[0].addEventListener("ended",videoEnde,false);
}on the second visit it marks $(...) in line 3 as unidentified.
Is it possible that - when video has ended - all variables e.g. $("#FWA")[0].src, $("#FWA")[0].currentTime and so on keeps in memory and entering Frame 6 again the Browser tries to load the same video file a second time?
Did anyone had the same problem or an idea why happened what happened? Thank you in advance.
