In a basic audio AVPlayer
instance, we're playing back an HLS stream and setting the Now Playing info (successfully), but cannot access the properties of the MPNowPlayingInfoCenter
that are being set.
The category
and active
status of our AVAudioSession
and are receiving remote control events without issue as well.
NSMutableDictionary *properties = [[NSMutableDictionary alloc] init];
[properties setObject:title forKey:MPMediaItemPropertyTitle];
// Set several other properties
MPNowPlayingInfoCenter *center = [MPNowPlayingInfoCenter defaultCenter];
[center setNowPlayingInfo:properties];
// Works! The lock screen successfully shows the title and other properties
NSLog("%@", [center nowPlayingInfo]);
The NSLog
prints a very default-looking dictionary containing only a MPNowPlayingInfoPropertyPlaybackRate
of 0
- which is not accurate anyway as the audio is playing back during the log.
We want to retrieve the currently-set dictionary of properties, update a few, and set them again (for things like album art updates, play/pause timings, etc). What are we missing?