ios - currentPlaybackTime 和 MPMusicPlayerController 以及 iOS 7.1 的问题

标签 ios iphone audio ios7.1 mpmusicplayercontroller

在 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/

相关文章:

有其他第三方库时iOS Frameworks : Ways to make this better,?

ios - viewDidLoad 中的调用函数崩溃

ios - 进入后台时保护显示数据 : applicationDidEnterBackground

java - 在 Java 中生成正弦波时背景噪声

c# - 如何使用C#播放PC扬声器的音高

ios - 获取 facebook 个人资料图片 URL

iphone - 将 Xcode 项目导入到另一个项目中,而不使用源代码树

iphone - 通过NSNotification设置时,UIImageView.image需要花费几秒钟的时间才能显示

iphone - 获取低级 iPhone 网络信息

haskell - 使用 Haskell 绑定(bind)保存脉冲音频流