在 iOS 7.1 中使用 MPMusicPlayerController 设置 currentPlaybackTime 时出现问题。 我曾经能够简单地执行以下操作:
MPMusicPlayerController *iPodController =
[MPMusicPlayerController applicationMusicPlayer];
iPodController.currentPlaybackTime = 30.0;
[iPodController play];
音乐播放器会寻找 30 秒并开始播放。
从 iOS 7.1 开始,情况就不是这样了。
如果我执行以下操作:
[iPodController play];
iPodController.currentPlaybackTime = 30.0;
然后它“可能”跳入或不跳入 30 秒。非常不一致。
这曾经适用于所有以前的 iOS 版本。有办法解决这个问题吗?
最佳答案
我发现我无法在播放给定歌曲之前设置 currentPlaybackTime
。
使用您的第一个片段:
iPodController.currentPlaybackTime = 30.0;
[iPodController play];
设置 currentPlaybackTime
属性没有任何作用,我无法找到所需的播放时间。但到目前为止,我在 iOS 7.1 上以相反的方式进行调用一直有效:
[iPodController play];
iPodController.currentPlaybackTime = 30.0;
关于ios - currentPlaybackTime 和 MPMusicPlayerController 以及 iOS 7.1 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22540282/