Skip to main content
Inspiring
November 21, 2019
Answered

Very Limited Actions In HTML Canvas. Doesnt Have Levels, Audio, Video Loading Scripts ?

  • November 21, 2019
  • 2 replies
  • 667 views

When we have a HTML5 canvas project, i see the HTML5 canvas scripts are very basic, just a few to select from, such as gotoAndPlay etc, theres no sound loading scripts, video loading scripts etc. How does one do audio and video loading. What about webpage levels ? So basically ANIMATE cant do everything that flash could when it came to website design ?

This topic has been closed for replies.
Correct answer ClayUUID

You "load" video by dynamically creating a div floated over the Animate canvas element and then putting an HTML video element in it.

 

This is how you dynamically load and play sounds:

https://createjs.com/docs/soundjs/modules/SoundJS.html

 

I have no idea what you mean by "webpage levels".

2 replies

ClayUUIDCorrect answer
Legend
November 25, 2019

You "load" video by dynamically creating a div floated over the Animate canvas element and then putting an HTML video element in it.

 

This is how you dynamically load and play sounds:

https://createjs.com/docs/soundjs/modules/SoundJS.html

 

I have no idea what you mean by "webpage levels".

Inspiring
December 8, 2019

Hi Clay, Thanks for the reply. To start with i tried the audio js in my animate project and nothing happened. I have the mp3 which is Violin.mp3 in the same local folder of the project and want to load it as a background sound to the webpage. I changed "sound" in the script given to "Violin.mp3" and left the others as is. It didnt work. Then i tried a lot of other other permutations and combinations of replacing, but still it doesnt work. Can you please hint which keywords in that script shold contain my local mp3 files name ?

Gooneybird12
Participating Frequently
November 25, 2019

When using HTML5 canvas, you have the full power of javascript.  Animate uses the CreateJS libraries, specifically.