The Web SDK subscribePlayerState method is no longer streaming player state events. Instead its returning an error in the JS console:
Uncaught TypeError: null: type 'minified:p1' is not a subtype of type 'bool'
at Object.b (js_helper.dart:1130)
at Object.dy (rti.dart:1108)
at a4L.$1 (player_restrictions.g.dart:11)
at a4X.$1 (stream.dart:554)
at Nm.k8 (zone.dart:1546)
at nv.i1 (stream_impl.dart:341)
at ny.Br (stream_impl.dart:591)
at rP.KN (stream_impl.dart:706)
at aaZ.$0 (stream_impl.dart:663)
at Object.aBJ (schedule_microtask.dart:40)
disallows: { // A simplified set of restriction controls for
pausing: false, // The current track. By default, these fields
peeking_next: false, // will either be set to false or undefined, which
peeking_prev: false, // indicates that the particular operation is
resuming: false, // allowed. When the field is set to `true`, this
seeking: false, // means that the operation is not permitted. For
skipping_next: false, // example, `skipping_next`, `skipping_prev` and
skipping_prev: false // `seeking` will be set to `true` when playing an
// ad track.
Here's a diff that helps confirm what is happening and works as a quick fix
Describe the bug
The Web SDK subscribePlayerState method is no longer streaming player state events. Instead its returning an error in the JS console:
To Reproduce Steps to reproduce the behavior:
Follow the docs for the web SDK and define a
Expected behavior
I expect the player state stream function to be called with player state events;
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
This was working just fine and suddenly broke today.
It looks like we're getting
null
values in the Web Playback State object, but the Dart SDK is not prepared to handle them.The docs do state that these properties can be null:
https://developer.spotify.com/documentation/web-playback-sdk/reference/#object-web-playback-state
Here's a diff that helps confirm what is happening and works as a quick fix
This prints: