Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Sahulhameed9094 opened this issue Oct 27, 2023 · 0 comments
Open

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

Sahulhameed9094 opened this issue Oct 27, 2023 · 0 comments

Comments

@Sahulhameed9094
Copy link

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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant