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

前端之家收集整理的这篇文章主要介绍了MPMoviePlayerController寻找前进按钮停止IOS7中的视频?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在iOS 7中面临MPMoviePlayerController的问题.当我单击前向搜索按钮时,视频停止并且不允许执行任何类似于再次播放全屏和滑块更改的操作.

这是我的代码.
删除MPMoviePlayerPlaybackDidFinishNotification的Observer

[[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.

原文链接:https://www.f2er.com/iOS/331546.html

猜你在找的iOS相关文章