Skip to content

Why does audio on iOS stop when unplugging headphones? #332

@Sahulhameed9094

Description

@Sahulhameed9094

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

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions