Can't play music with MusicKitJS

I'm experimenting with the MusicKitJS SDK for web, and I was able to get it to display all my Apple Music Cloud albums (so I know that the developer JWT key I'm using is in fact valid). However when I try to play any of them nothing comes through. I don't even get any JS errors in my browser console. This is the code I'm using:


let music = MusicKit.getInstance();
music.authorize().then(function() {
     music.setQueue({
          album: 'l.cefDzti' //Oasis - "(What's the Story) Morning Glory (don't judge ;))
     ).then(function() {
          music.play();
     }
}

Based on the instructions, it should start playing the album through the browser. Do I need to add any HTML5 audio tags and decorate them? I tried that without any luck.


Thanks in advance.


- Scott

Replies

I just figured this out. For anyone else who runs into this issue, replace:


music.play()

with

music.player.play()


In Safari, you might also need to make sure you're auto play settings are set to allow.