gpt4 book ai didi

ios - MPMusicPlayerController 是否更新播放计数?

转载 作者:行者123 更新时间:2023-12-01 16:52:43 27 4
gpt4 key购买 nike

在我的测试中,似乎通过 MPMusicPlayerController 播放 MPMediaItem 不会更新播放计数(使用 iPod 或应用程序实例)

谁能证实这一点?我也没有在文档中看到任何内容。

最佳答案

在我的测试中,iPodMusicPlayer 的播放次数都会更新。和 applicationMusicPlayer .

首先,我跳到了歌曲的结尾。然后我跳回上一首轨道并使用 valueForProperty 测试播放次数。得到 MPMusicPlayerControllerNowPlayingItemDidChangeNotification 后:

- (void)handleNowPlayingItemChange:(NSNotification *)itemNotification {
MPMediaItem *currentMediaItem = [[self musicPlayer] nowPlayingItem];
NSNumber *currentPlayCount = [currentMediaItem valueForProperty:MPMediaItemPropertyPlayCount];
NSLog(@"Current play count: %@", currentPlayCount);
}

关于ios - MPMusicPlayerController 是否更新播放计数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14370838/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com