gpt4 book ai didi

ios - MPMoviePlayerController 寻找前进按钮停止 IOS7 中的视频?

转载 作者:可可西里 更新时间:2023-11-01 03:35:06 25 4
gpt4 key购买 nike

我在 iOS 7 中面临 MPMoviePlayerController 的问题。当我单击向前搜索按钮时,视频停止并且不允许执行任何操作,例如全屏播放和 slider 更改。

这是我的代码。移除 MPMoviePlayerPlaybackDidFinishNotification

的观察者
[[NSNotificationCenter defaultCenter] removeObserver:moviePlayerViewController  name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerViewController.moviePlayer];

并添加新通知 MPMoviePlayerPlaybackDidFinishNotification

 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(videoFinished:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil];

这是我处理 MPMoviePlayerPlaybackDidFinishNotification

的自定义方法
-(void)videoFinished:(NSNotification*)aNotification{
MPMoviePlayerController *moviePlayer = [aNotification object];
NSLog(@"%f",moviePlayer.currentPlaybackTime);

int reason = [[[aNotification userInfo] valueForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey] intValue];
if (reason == MPMovieFinishReasonPlaybackEnded) {
}else if (reason == MPMovieFinishReasonUserExited) {
[self performSelector:@selector(dismiss:) withObject:aNotification afterDelay:0.5];
}else if (reason == MPMovieFinishReasonPlaybackError) {
}

}

我需要通过单击来停止这种奇怪的行为并继续播放。

有人知道怎么做吗?谢谢。

最佳答案

I think there are no any notifications or event are available on user interaction with the standard player buttons, and i have to implement own UI for the player controls. by this way we can then determine the actions for a single touch, long touch, etc. Then, we can add whatever functionality like increasing the play rate, or simply seeking to a time.

关于ios - MPMoviePlayerController 寻找前进按钮停止 IOS7 中的视频?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20585661/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com