ionic-audio icon indicating copy to clipboard operation
ionic-audio copied to clipboard

Play one audio at a time

Open chahalsukhveer opened this issue 10 years ago • 15 comments

It should pause already playing audio when user click play button for another audio.

chahalsukhveer avatar Oct 29 '16 15:10 chahalsukhveer

Just to comment on this - I'm building an app right now that is dependent on playing multiple audio files at the same time, so I wouldn't want this behavior as the default. The developer has complete control right now pause all other audio before playing a different track, and I personally think that's how it should remain. Cheers!

alkrauss48 avatar Apr 17 '17 13:04 alkrauss48

When this commit is going to be merged in 2.0 branch?

dhaval85 avatar May 01 '17 06:05 dhaval85

I think @alkrauss48 is right. The developer can control when/if to stop all other audio using the API.

arielfaur avatar May 01 '17 16:05 arielfaur

@alkrauss48 : How can one control the behavior? I tried but it seems it requires patch like the one provided by @chahalsukhveer .

Are there any events on which I can register a function?

dhaval85 avatar May 01 '17 16:05 dhaval85

@dhaval85 You are right, it looks like there is no global event to subscribe to on playback. I will submit a patch as soon as I can.

arielfaur avatar May 01 '17 16:05 arielfaur

@arielfaur : Thanks man. Let me know if I can help. I haven't seen the source code of this plugin yet but can review and add some more features. Let me know if you have any specific to implement this event stuff. We can support many other than only just play event.

Besides, I think a configuration option would be good to control this behavior. What do you say?

dhaval85 avatar May 01 '17 16:05 dhaval85

A configuration option for what purpose?

arielfaur avatar May 01 '17 16:05 arielfaur

@arielfaur configuration option to allow multiple songs play at the same time or not.

dhaval85 avatar May 01 '17 16:05 dhaval85

Ok, I get it. I will look into that.

arielfaur avatar May 01 '17 16:05 arielfaur

@arielfaur Alright. Meantime I will see if I can submit a patch. Is 2.0 branch still active?

dhaval85 avatar May 01 '17 16:05 dhaval85

No, we are on 3.0 now.

arielfaur avatar May 01 '17 16:05 arielfaur

Ahh okay. Is 3.0 compatible with Ionic 2.0?

dhaval85 avatar May 01 '17 16:05 dhaval85

Not really, it is based on Ionic 3 and Angular 4.

arielfaur avatar May 01 '17 17:05 arielfaur

Looks like I have to consider switching to Ionic 3. Or probably whatever fixes you do in 3.0 branch. I will replicate them in 2.0.

dhaval85 avatar May 01 '17 17:05 dhaval85

How to solve song overlap..when i click particular song,it play well after if i return back to other page then i click any other particular song,2 songs will play at a time @arielfaur

vigneshrvicky avatar Aug 13 '18 15:08 vigneshrvicky