devgeeks / ExampleHTML5AudioStreaming

Example project showing audio streaming using HTML5 Audio with PhoneGap on iOS - https://build.phonegap.com/apps/242993
164 stars 61 forks source link

Android loop playing #11

Open Alkashi opened 8 years ago

Alkashi commented 8 years ago

Hi,

I'm trying to play a playlist composed by many mp3. When an mp3 plays arrive at the end, I want the other mp3 in stack plays automatically. For that, I listent to the "ended" event and play the following mp3 when it's fired.

On iOS, everything works fine and the followings mp3 are played event if the iPhone is locked and the screen turned off.

On Android, it works only when the app is foreground and the screen turned on. When the screen if off, the event is fired but the following mp3 is never played.

Do you have an idea on how to solve the issue on Android ?

ghenry22 commented 8 years ago

I've noticed the same in my own app. Going to try the Cordova media plugin to see if it behaves differently to the html5 audio element, but would also be interested to here if there is a known way to work around this.

Cheers Gaven

On 4 Jul 2015, at 6:07 pm, Alkashi notifications@github.com wrote:

Hi,

I'm trying to play a playlist composed by many mp3. When an mp3 plays arrive at the end, I want the other mp3 in stack plays automatically. For that, I listent to the "ended" event and play the following mp3 when it's fired.

On iOS, everything works fine and the followings mp3 are played event if the iPhone is locked and the screen turned off.

On Android, it works only when the app is foreground and the screen turned on. When the screen if off, the event is fired but the following mp3 is never played.

Do you have an idea on how to solve the issue on Android ?

— Reply to this email directly or view it on GitHub.

Alkashi commented 8 years ago

I've ever try with the media plugin and it works well with some adjustments.

But if someone has an idea about this issue...