在我的應用程序中,我需要從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;
}];
}
}];
}