currentPlaybackTime和MPMusicPlayerController和iOS 7.1的问题 [英] Problems with currentPlaybackTime and MPMusicPlayerController and iOS 7.1

查看:106
本文介绍了currentPlaybackTime和MPMusicPlayerController和iOS 7.1的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS 7.1中使用MPMusicPlayerController设置currentPlaybackTime时出现问题. 我曾经能够简单地执行以下操作:

Having problems setting currentPlaybackTime with MPMusicPlayerController in iOS 7.1. I used to be able to simply do the following:

MPMusicPlayerController *iPodController =
[MPMusicPlayerController applicationMusicPlayer]; 
iPodController.currentPlaybackTime = 30.0;
[iPodController play];

音乐播放器将搜索30秒然后播放.

And the music player would seek to 30 seconds in and play.

从iOS 7.1开始,情况并非如此.

As of iOS 7.1 this is not the case.

如果我执行以下操作:

[iPodController play];
iPodController.currentPlaybackTime = 30.0;

然后它可能"跳入或跳出30秒.非常不一致.

Then it "may" jump 30 secs in or not. Very inconsistent.

此功能以前可用于所有以前的iOS版本.有办法解决这个问题吗?

This used to work for all previous iOS versions. Is there a way to fix this?

推荐答案

我发现我无法在播放给定歌曲之前设置currentPlaybackTime.

I find that I can't set currentPlaybackTime before playing a given song.

使用您的第一个片段:

iPodController.currentPlaybackTime = 30.0;
[iPodController play];

设置currentPlaybackTime属性不会执行任何操作,因此无法找到所需的播放时间.但到目前为止,使用iOS 7.1进行呼叫的另一种方法对我来说一直有效:

setting the currentPlaybackTime property does nothing and I can't seek to the desired playback time. But making the calls the other way around have worked consistently for me with iOS 7.1 so far:

[iPodController play];
iPodController.currentPlaybackTime = 30.0;

这篇关于currentPlaybackTime和MPMusicPlayerController和iOS 7.1的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆