MPMoviePlayer 不再向前搜索,而是发出警告
因此,看起来我的 MPMoviePlayer 不再想要向前搜索,尽管搜索是由 MoviePlayer 在内部完成的,所以我应该做的就是设置通知以便知道正在发生搜索。
所以我这样设置我的通知:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playbackStateDidChange:)
name:MPMoviePlayerPlaybackStateDidChangeNotification object:theMovie];
然后,在playbackStateDidChange:内部有以下相关代码:
MPMoviePlayerController *mpc = [notification object];
MPMoviePlaybackState state = mpc.playbackState;
if (state==MPMoviePlaybackStateSeekingForward)
NSLog(@"playback state is seeking forward");
最后,当我按住向前搜索按钮时,playbackStateDidChange确实被调用,并且确实说“播放状态正在向前搜索”,但我看到电影的行为没有明显的变化。但是,第二次我尝试向前搜索时,我在控制台中收到此警告:
警告:_inflightSeekRate 已设置,这意味着在收到 _rateDidChangeNotification 之前已进行多次 setRate:error: 调用
所以基本上,向前搜索不起作用正确地,我有一种预感,这是一个 MPMoviePlayer 错误,但我在网上找不到任何东西来支持我的主张,也没有回答我的问题。如果有人对如何处理这个问题有任何好的想法(也许是解决方法),我会洗耳恭听。
谢谢;
-史蒂夫
·P.S. - 我应该提到,我的 MPMoviePlayer 搜索工作一直很好,直到我上周升级了我的 X-Code/iPhone SDK。现在看来,除了向前寻求之外,一切都很好。
So it appears as though my MPMoviePlayer no longer wants to seek forward, despite it being the case that seeking is done internally by the MoviePlayer, so all I should be doing is setting up notifications in order to know that seeking is occurring.
So I setup my notification as such:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playbackStateDidChange:)
name:MPMoviePlayerPlaybackStateDidChangeNotification object:theMovie];
Then, inside playbackStateDidChange: I have the following relevant code:
MPMoviePlayerController *mpc = [notification object];
MPMoviePlaybackState state = mpc.playbackState;
if (state==MPMoviePlaybackStateSeekingForward)
NSLog(@"playback state is seeking forward");
Finally, when I hold down the forward seek button, playbackStateDidChange indeed gets invoked, and indeed says "playback state is seeking forward," but I see no discernible change in the behavior of the movie. However, the 2nd time I try to seek forward I receive this warning in my console:
WARNING: _inflightSeekRate already set, which means multiple setRate:error: calls have been made before a _rateDidChangeNotification was received
So basically, the forward seek isn't working properly, and I have a hunch that this is an MPMoviePlayer bug, but I couldn't find anything online to back my claim, nor answer my question. If anybody has any good ideas about how to handle this issue (maybe a workaround) I'm all ears.
Thanks;
-Steve
P.S. - I should mention that my MPMoviePlayer seeking worked just fine until I upgraded my X-Code/iPhone SDK last week. Now it appears to be just fine, except for the forward seeking.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论