Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在创建一个音乐应用程序,就像标准音乐应用程序一样。现在,我对他们如何能够使用 UISlider 读取和更改歌曲的经过时间感到困惑。如何读取和更改歌曲的经过时间?
通过调用beginGeneratingPlaybackNotifications并MPMusicPlayerController注册MPMusicPlayerControllerPlaybackStateDidChangeNotification通知,您将在播放状态发生变化时收到定期更新。然后,在该通知的处理程序中,您可以currentPlaybackTime从MPMusicPlayerController.
beginGeneratingPlaybackNotifications
MPMusicPlayerController
MPMusicPlayerControllerPlaybackStateDidChangeNotification
currentPlaybackTime