Skip to main content
pete.manzel
Inspiring
June 14, 2021
Question

HTML5 Canvas Video

  • June 14, 2021
  • 1 reply
  • 147 views

Hi, i have placed a video in a HTML5 Canvas that plays as expected.

As the video does not show up in the timeline (it lives inside one frame), how do i ad a button or action at a certain time after the video has started playing?

 

Thanks for any help!

Regards

Pete

    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    Community Expert
    June 14, 2021

    you use code.  eg, if your video player component has instance name videoPlayer, use

     

    var video;
    function checkInitF() {
    if (video) {
    video.addEventListener("ended", function(){
    // video ended. do whatever
    });
    } else {
    video = $("#videoPlayer")[0];
    setTimeout(checkInitF, 100);
    }
    }
    checkInitF();