Open Rudloff opened 6 years ago
Thanks for the report @Rudloff! As you mentioned, mobile browsers aren't officially supported, but I'll take this to the team and see if there's a way to catch that error and handle it better. Do you have an example app that reproduces this? It'd be really helpful for us.
This might be an issue for android now. But it might be an issue for chrome desktop soon as well: https://github.com/spotify/web-playback-sdk/issues/33#issuecomment-431498472
This may help you.
int SDK_INT = android.os.Build.VERSION.SDK_INT;
if (SDK_INT > 16) {
WebViewWithJavaScript.getSettings().setMediaPlaybackRequiresUserGesture(false);
}
Issue found on 2018-04-01.
Scope(s):
streaming user-read-birthdate user-read-email user-read-private user-library-read
Steps to reproduce:
I'm using Chrome 63 on Android 6.0.
https://api.spotify.com/v1/me/player/play
with the current app asdevice_id
.Expected behaviour:
The track starts playing.
Actual behaviour:
Chrome throws this exception:
(Because the play action is indeed started by the API and not directly by the click event.)
But subsequent calls to
player.resume()
work correctly if they are initiated by a click event.So as a workaround I had to use this after the API call:
(I know mobile browsers are not officially supported but everything else works fine in Android Chrome.)