获取 MPMusicPlayer 的当前位置

Get current position of MPMusicPlayer

我想知道如何获取 MPMusicPlayer 的当前位置。例如,如果音乐播放器正在播放一首歌曲,当前时间为 0 分 23 秒,我将如何获取并设置该值?

以下链接可以帮到您-

How to set music playback slider in music player

Problems with currentPlaybackTime and MPMusicPlayerController and iOS 7.1.

Using MPMusicPlayerController, setting musicPlayer.currentPlaybackTime to seek but takes second to take effect

https://github.com/gangverk/GVMusicPlayerController

请使用下方属性获取当前位置

mpMusicPlayer.currentPlaybackTime