Using AVPlayer to play Apple Music MusicVideos

In my app I'm trying to play an Apple Music video using

VideoPlayer(player: AVPlayer(url: video.url!))

where "video" is a MusicVideo instance but all I get is a blank player. video.title and video.artistName work fine

I've tried using fileURLWithPath and string also, which work with hosted videos no problem

(apologies for the poor use of terms, newbie)

  • Is the only way to view MusicVideos through a WKWebView?

Add a Comment

Accepted Reply

Hello @AntMaz,

Playing Music Videos with MusicKit framework is not currently possible.

See this older thread for reference.

That said, I would strongly encourage you to file a new ticket on Feedback Assistant asking for new public API to be introduced to play Music Videos using MusicKit framework.

Best regards,

  • Thanks Joe, I’ve submitted a feedback request.

    Could you recommend a workaround?

  • I added the code from the older thread link and it works brilliantly, thanks again Joe

Add a Comment

Replies

Hello @AntMaz,

Playing Music Videos with MusicKit framework is not currently possible.

See this older thread for reference.

That said, I would strongly encourage you to file a new ticket on Feedback Assistant asking for new public API to be introduced to play Music Videos using MusicKit framework.

Best regards,

  • Thanks Joe, I’ve submitted a feedback request.

    Could you recommend a workaround?

  • I added the code from the older thread link and it works brilliantly, thanks again Joe

Add a Comment