MusicKit Web Playback States

In MusicKit Web the playback states are provided as numbers.

For example the playbackStateDidChange event listener will return:

{oldState: 2, state: 3, item:...}

When the state changes from playing (2) to paused (3).

Those are pretty easy to guess, but I'm having a hard time with some of the others: completed, ended, loading, none, paused, playing, seeking, stalled, stopped, waiting.

I cannot find a mapping of states to numbers documented anywhere. I got the above states from an enum in a d.ts file that is often incorrect/incomplete.

Can someone help out pointing to the docs or provide a mapping?

Thanks.

I could be wrong, but I think that the numbers might actually be the order of these here, if they were an array.

Would be nice if those docs were updated.

values can be found in musickit.js source code:

    (e[(e.none = 0)] = "none"),
    (e[(e.loading = 1)] = "loading"),
    (e[(e.playing = 2)] = "playing"),
    (e[(e.paused = 3)] = "paused"),
    (e[(e.stopped = 4)] = "stopped"),
    (e[(e.ended = 5)] = "ended"),
    (e[(e.seeking = 6)] = "seeking"),
    (e[(e.waiting = 8)] = "waiting"),
    (e[(e.stalled = 9)] = "stalled"),
    (e[(e.completed = 10)] = "completed"),
MusicKit Web Playback States
 
 
Q