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)

Answered by Frameworks Engineer in 709245022

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,

Is the only way to view MusicVideos through a WKWebView?

Accepted Answer

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,

Using AVPlayer to play Apple Music MusicVideos
 
 
Q