soundcloud-audio.js icon indicating copy to clipboard operation
soundcloud-audio.js copied to clipboard

iOS - Play next track while device is locked

Open alexweinstein opened this issue 5 years ago • 1 comments

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?

alexweinstein avatar Jun 18 '19 21:06 alexweinstein

Hi @alexweinstein, thanks for letting me know, I will check if it's a bug in the lib or OS related 👍

voronianski avatar Jun 30 '19 18:06 voronianski