APAudioPlayer icon indicating copy to clipboard operation
APAudioPlayer copied to clipboard

MPNowPlayingInfoCenter can not update duration, current time

Open huynguyencong opened this issue 7 years ago • 0 comments

When I play a file use AVAudioPlayer, I can show info to control center with MPNowPlayingInfoCenter. But when use APAudioPlayer, it can't update current time, duration to control center.

let currentPlayingInfo = [
   AVMetadataCommonKeyTitle: "Song title",
   MPMediaItemPropertyPlaybackDuration: 300,
   MPNowPlayingInfoPropertyElapsedPlaybackTime: TimeInterval(player.position) * player.duration()
]

MPNowPlayingInfoCenter.default().nowPlayingInfo = currentPlayingInfo

huynguyencong avatar Aug 17 '17 05:08 huynguyencong