We develop a cross platform multimedia player. It uses OpenAL for playing audio. On iOS we want to use functionality of the MPNowPlayingInfoCenter and Remote Control Events.
Setting current position, elapsed time, other track info works well. But, unfortunately, when pressing the pause button in the info center player pauses, but the pause button does not change its status. Info center continues showing that playback isn't paused (time labels continue counting).
We handle the UIEventSubtypeRemoteControlPause event in this way:
[self.player pause]; // Pause playback
// Update MPNowPlayingInfoCenter
NSMutableDictionary *mediaInformation = [NSMutableDictionary dictionaryWithDictionary:[MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo];
mediaInformation[MPNowPlayingInfoPropertyPlaybackRate] = @0.0;
mediaInformation[MPNowPlayingInfoPropertyElapsedPlaybackTime] = @(self.player.currentTime);
[MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo = mediaInformation;
Does MPNowPlayingInfoCenter support playing audio through OpenAL or we missed something. Thanks for any help.
Aucun commentaire:
Enregistrer un commentaire