Skip to content

MPNowPlayingInfoCenter can not update duration, current time #19

@huynguyencong

Description

@huynguyencong

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions