自定义 iPod 播放器不会更新 MPMediaItem 值,例如 MPMediaItemPropertyLastPlayedDate
我想使用应用程序扫描用户的 iPod 库。因此我想使用 MPMediaItemPropertyLastPlayedDate 获取上次播放歌曲的时间(或天、小时)。
问题是,如果我在应用程序内的播放界面(只是带有插图、标题和播放/暂停按钮的视图)播放该歌曲,MPMediaItem 不会在 iPod 库中更新。
有没有办法在我自己的应用程序中按下播放按钮后手动更新刚刚播放的 MPMediaItem 。
我猜它应该发生在这里的某个地方:
- (void)mediaPicker:(MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)theCollection {
... HOW SHOULD I TELL THE IPOD LIBRARY TO UPDATE e.g. LastPlayedDate or PlayCounter
}
I want to scan the users iPod library with an App. therefore i want to use MPMediaItemPropertyLastPlayedDate for getting the time in seconds (or days, hours) when the song was played the last time.
Problem is, that if i play that song my playing terface within the app (just a view with artwork, title and a play/pause button), the MPMediaItem doesn't get updated in the iPod Library.
is there a way to manually update that just played MPMediaItem after i pressed the play button within my own app.
i guess its supposed to happen somewhere here:
- (void)mediaPicker:(MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)theCollection {
... HOW SHOULD I TELL THE IPOD LIBRARY TO UPDATE e.g. LastPlayedDate or PlayCounter
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它会更新数据,只需听整首歌曲即可。下一首歌曲开始后,将设置最后播放的日期和播放时间。
它正在与共享音乐播放器一起使用。我还没有尝试过应用程序音乐播放器。
It updates the data, just listen the whole song. After the next song has begun, the last played date and playtime will be set.
It is woring with sharedmusicplayer. I haven't tried with application music player.