Hi there!
I have been trying to play the music videos we get from Apple Music API and have been unsuccessful.
Here's my code:
var video: MusicVideo
var body: some View {
VideoPlayer(player: AVPlayer(url: video.url!))
}
I know the URL from the MusicVideo
is not in a music format but just the URL to the video in the Apple Music catalog.
How do I go about playing it without using something like MPMusicPlayerController.systemMusicPlayer.openToPlay(queueDescriptor)
and provide an in-app experience (and not take the user to the Apple Music app)?