Skip to main content
Inspiring
October 15, 2019
Question

Mp3 and createjs

  • October 15, 2019
  • 1 reply
  • 1979 views

I have this code in the HTML5 canvas fla document:
createjs.Sound.on("fileload", handleFileLoad);
createjs.Sound.registerSound("music1.mp3", "MySound");

function handleFileLoad()
{
createjs.Sound.play("MySound");
}
It doesn't launch in both Chrome or Android but in Microsoft Edge where it works.
In the Chrome console it says: "createjs-2015.11.26.min.js:17 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
c._generateCapabilities @ createjs-2015.11.26.min.js:17
2createjs-2015.11.26.min.js:17 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
b._createAndPlayAudioNode @ createjs-2015.11.26.min.js:17"

It has worked once with an HTML5 canvas fla document
Is the error in the createjs codes and why has it stopped working. So please help with solving this.

    This topic has been closed for replies.

    1 reply

    Legend
    October 15, 2019

    It's already telling you in plain English exactly what the problem is. Why are you refusing to believe it? Modern browsers don't autoplay audio unless the user has interacted with the page.

    peorAuthor
    Inspiring
    October 16, 2019
    Why does it work in Microsoft browser Edge than Google Chrome and Android. Is it wrong in createjs. It worked when I did a slideshow but it be a few times before but not now anymore. What happened. I want to be able to play an mp3 song without having a button that starts it.