在我的应用程序中,我需要从vimeo播放电影,这很好,但是我的洞应用程序仅适用于肖像。我想在特定的viewController中播放电影,并强制此控制器能够旋转为纵向或横向。IOS如何确定视频剪辑何时完成播放
当有人点击电影的缩略图时,我会选择到VideoViewController,我需要知道如何确定此影片剪辑何时完成,以便在视频完成后可以直接将其缩回。
代码;
@implementation VideoViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self vimeoVideo];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)vimeoVideo
{
[YTVimeoExtractor fetchVideoURLFromURL:@"http://vimeo.com/1071123395"
quality:YTVimeoVideoQualityMedium
referer:@"http://xxxxx.com"
completionHandler:^(NSURL *videoURL, NSError *error, YTVimeoVideoQuality quality) {
if (error) {
// handle error
NSLog(@"Video URL: %@", [videoURL absoluteString]);
} else {
// run player
self.playerView = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL];
[self.playerView.moviePlayer prepareToPlay];
[self presentViewController:self.playerView animated:YES completion:^(void) {
self.playerView = nil;
}];
}
}];
}