soundcloud-audio.js
soundcloud-audio.js copied to clipboard
iOS - Play next track while device is locked
Not sure if this is new behavior or I just never paid attention.
I'm using the latest soundcloud-audio.js version (1.4.0) on an iPhone X with the most recent OS. If a user chooses a track it will play normally. When the song is completed, the next track in a list is played. However, when the device is locked or has gone to sleep, it simply stops at the end of the selected track.
Here's what I'm using:
function playTrack(track-identifier-example){
global.currentSoundObject.play({
streamUrl: track-identifier-example_stream_url
});
global.currentSoundObject.on('ended', function() {
playTrack(next-track-identifier-example);
});
}
Anyone else seeing this behavior? Should I be triggering the next track in a different way or is this a bug?
Hi @alexweinstein, thanks for letting me know, I will check if it's a bug in the lib or OS related 👍