Post

Replies

Boosts

Views

Activity

mediaPlaybackError callback never fires
Greetings Fellow Humans, My player uses the v3 musickit-js library. I am trying to handle situations where a user tries to play explicit content in my player with an account that has content restrictions enabled. I don't see a mechanism to know if the toggle is set in the account. The only mechanism I see is to respond to a CONTENT_RESTRICTED error as handled by the callback to the function I provide as a callback to the mediaPlaybackError event. I have attached many callbacks (like bufferedProgressDidChange) and those all work, but this one never fires. music.addEventListener("mediaPlaybackError", onPlaybackError); Or music.addEventListener(MusicKit.Events.mediaPlaybackError, onPlaybackError); My onPlaybackError function, at least for debugging purposes, is: function onPlaybackError(e) { console.log("onPlaybackError"); console.log(e); } There are so many error conditions that are meant to be handled in this way but the callback never happens. Am I missing something? Why doesn't this callback fire? Thanks!
1
0
637
Dec ’23
MusicKit JS: Chromium based browsers only get 30 second previews
I've got a little MusicKit JS page I'm working on and I'm running into this issue where the only browser that will play full tracks is Firefox (and Safari, obviously). I've tried several Chromium based browsers and MusicKit plays 30 seconds previews instead of full tracks. Other widevine content works in those browsers. I've tried: Brave Chrome Vivaldi Of course, the v2 library works on music.apple.com in Brave and others. v1 and v2 libraries behave the same for me in my page. The library knows it's authenticated. I can browse content in the catalog and the user's library. I just can't play more than 30 seconds at a time. Any crazy ideas? Thanks
1
0
699
Jun ’21