在 iOS4 中使用 MPMoviePlayerController 向前/向后查找时出现问题
我在 iOS 中的 MPMoviePlayerController 上遇到了一个奇怪的问题。
我有一个 MPMoviePlayerController,其控件样式为 none。 添加了我自己的 UISlider 以在电影中向前/向后寻找。
设置通知以查看播放状态的变化。
将player.currentPlaybackTime 设置为新值后,播放状态将转至MPMoviePlaybackStateSeekingForward 或MPMoviePlaybackStateSeekingBackward 并保持该状态。
我希望当搜索停止(找到新位置)并且播放器继续正常播放时,播放状态将返回到 MPMoviePlaybachStatePlaying,但事实并非如此。
这是正常行为还是我错过了什么?
I have a weird issue with the MPMoviePlayerController in iOS.
I have a MPMoviePlayerController with control style none.
Added my own UISlider to seek forward/backward in the movie.
Set up notifications to see a change in the playback state.
After setting player.currentPlaybackTime to a new value the playbackstate goes to MPMoviePlaybackStateSeekingForward or MPMoviePlaybackStateSeekingBackward and stays in that state.
I would expect that when the seeking stops (new position found), and the player continues to play normally the playbackstate would go back to MPMoviePlaybachStatePlaying but it doesn't.
Is this normal behaviour or am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题出在 UISlider 的属性 Continuous 上。将其设置为 no,当状态从前进/后退更改为播放时,您将收到通知。
self.playerControlsView.slider.Continous = NO;
我猜的问题是当连续属性设置为 YES 时。滑块将继续用户提供的滑动操作,并且不会触发状态更改。因此状态保持向前/向后。我对此不太确定,但答案就在这些方面。
希望这对某人有帮助:)
The problem is with UISlider's property continuous. Set it to no and you will be notified when the state will change from Forward/Backward to Playing.
self.playerControlsView.slider.continuous = NO;
The issue i guess is that when the continuous property is set to YES. The slider will continue the action of sliding the user is providing it and not trigger the state change. And hence the state remains forward/backward. I am not very sure about this but the answer is somewhere on these lines.
Hope this helps someone :)