Hello,
I have a question and I hope someone can help me out.
I'm trying to build a view that will respond to changes in ApplicationMusicPlayer.shared.queue. it gets back the current entity(MusicPlayer.Queue.Entry) with a lot of information but the endtime property isn't set. how can I resolve this issue?
Stap one Getting playlist information with all tracks from apple music
var request = MusicCatalogResourceRequest<Playlist>(matching: \.id, equalTo: playlist.musicID)
request.properties = [.tracks]
request.limit = 1;
if let tracks = try await request.response().items.first?.tracks {
viewModel.tracks = tracks
}
Step 2 Add tracks to Queue
ApplicationMusicPlayer.shared.queue = ApplicationMusicPlayer.Queue(for: viewModel.tracks)`
try await ApplicationMusicPlayer.shared.play()
Sep 3 Player Starts playing update the view with the current entry
I will successfully get title, subtitle and artwork but not a endtime that I need for building a nice playback timer
Kind regards, Reinier de la Parra
Hello @foxoffire33,
Regarding the issue where the song's duration or music video's duration is set to nil
in MusicPlayer.Queue.Entry's item, we have included a fix for this issue in iOS 15.4 Beta 1.
I hope this helps.
Best regards,