function load() {
var queue = new createjs.LoadQueue();
createjs.Sound.alternateExtensions = ["mp3"];
queue.installPlugin(createjs.Sound);
queue.addEventListener("fileload", handleFileLoad);
queue.addEventListener("complete", handleComplete);
queue.loadManifest({
id: "audio_1",
src: "http://commondatastorage.googleapis.com/codeskulptor-demos/DDR_assets/Kangaroo_MusiQue_-_The_Neverwritten_Role_Playing_Game.mp3",
});
}
function playIt() {
var instance = createjs.Sound.play('audio_1');
instance.on("complete", handleComplete2, this);
instance.on("error", function (e) { console.error(e); }, this);
}
When playing the audio using soundJS and unplugging the headphones, audio is not playing in the speaker, but it runs in the background without any sound and calls the complete function. Could you please take a look at the code below? thanks