Skip to main content
Participant
July 18, 2022
Answered

Adobe Animate HTML Canvas Video Help

  • July 18, 2022
  • 1 reply
  • 194 views

Hi all

 

Recently I have come back to a range of Animate lesson templates I created some time back which used videos and which were controlled by buttons, tickers and event handlers.

The method I used back then was using the following code:

 

path = this;
path.stop();

var video = document.createElement('video');
var mainVid = new createjs.Bitmap(video);
video.src='videos/testVid.mp4';
video.autoplay = true;
path.addChild(mainVid);

These lessons were used using Internet Explorer (I know!) and worked fine.  Since IE is now dead, I have discovered that Edge is no longer displaying these lessons and I need to update them.  I have noticed that if I place Edge in Internet Explorer mode they lessons works fine, but I need to update them so peeps don't have to go through this options 

 

Recreating the code in Animate and publishing to Edge doesn;t seem to work.  I noted I don;t get any errors messages in the console, but the when viewed the video element just doesn show - Other objects such as buttons and movieclips load fine - strange!

 

Does anyone still use this code or has got it working? Does anyone know why this might no longer be supported or have any ideas how I can fix it?

 

I started to look at the Video component route and have managed to make a test file and the video displays and I can control it very rudimentally - such and play, pause etc. 

I am not having much luck tracking down any info controlling the video component with code. 

 

Could someone point me in the right direction or have any experience contro;lling the video component with code? I would be looking for command equivelant to video.onended and set position, current time etc.

 

Cheers

    This topic has been closed for replies.
    Correct answer kglad

    you need user interaction (eg, mouse click) to start a video (or sound).

    1 reply

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    July 18, 2022

    you need user interaction (eg, mouse click) to start a video (or sound).

    Participant
    July 19, 2022

    @kglad 

    Thank you so much for replying.

    I have just tried your suggestion by adding a simple button and it worked first time. 

    So simple, but perfect!

    Luckily quite a few of them have the user interaction before the video plays, so it must have just been dumb luck I picked a few with no interaction at the start.

     

    Again many thanks! Great community here

     

    Cheers

    Ryan

    kglad
    Community Expert
    Community Expert
    July 19, 2022

    you're welcome.