Playing offline - no sound and no error messages
Issue found on 17/01/2020.
SDK Version: 0.7.0
OS Version: Android 9
Scope(s): ['streaming', 'user-read-birthdate', 'user-read-email', 'user-read-private', 'app-remote-control', 'user-read-playback-state', 'user-modify-playback-state']
Spotify Version: 8.5.40.195
Steps to reproduce:
- Start app in airplane mode (connection to spotify app works)
- Play album
spotify:album:4FxNfDSXqAg8N1D8NBtvZ5withskipToIndex()orplay() - Nothing happens, no error is thrown, result of call is
com.spotify.protocol.types.Empty@872db71
Expected behaviour:
Either it should play or I should receive an error.
Actual behaviour:
Nothing happens, no error is thrown, result of call is com.spotify.protocol.types.Empty@872db71
I receive the following state via subsciption:
PlayerState{track=null, isPaused=false, playbackSpeed=0.0, playbackPosition=0, playbackOptions=PlayerOptions{isShuffling=false, repeatMode=0}, playbackRestrictions=PlayerRestrictions{canSkipNext=false, canSkipPrev=false, canRepeatTrack=true, canRepeatContext=true, canToggleShuffle=true}}
My implementation:
mSpotifyAppRemote.getPlayerApi().skipToIndex(uri, offset)
.setResultCallback((result) -> {
Log.d("SpotifyPlugin", "Start playing " + uri + " at offset " + offset +" and seek to " + position);
Log.d("SpotifyPlugin", result.toString());
if (position > 0) {
mSpotifyAppRemote.getPlayerApi().seekTo(position);
}
call.success();
}).setErrorCallback((throwable) -> {
Log.e("SpotifyPlugin", "Error playing", throwable);
call.reject(throwable.getMessage(), new Exception(throwable));
});
I can see the Start playing in the log. But nothing happens.
I did some further testing in which I started playback while having network. Then I activated the airplane mode. Playback seems to continue track after track.
I can even interact with seek()/skip() and this works fine in offline mode. But as soon as I call skipToIndex() or play() the playback stops.
Hi @tobika We are working on fixing this issue.
Thanks for your patience.
@mdelolmo thank you so much. I just tried it today with the latest Spotify Update and it seems to work really well now :)
I have found a bug during offline playback.
Using mSpotifyAppRemote.getPlayerApi().skipToIndex(uri, offset) for album playback with an offset of 149 works perfect.
Using an offset of 150 or greater doesn't work.
Should I create another issue?