问题描述
我开始使用 XCDYouTubeVideoPlayer
。它似乎有一些小问题。当我使用该方法(如下所示)调用播放器时,它会打开它并立即关闭它。
I've start working with XCDYouTubeVideoPlayer
. It does seem to have, some small issues. When I use the method (like below) to call the player it opens it and close it right away.
我导入了以下框架:
mediaplayer
AVfoundation
I've imported following frameworks:mediaplayer
AVfoundation
并添加了`XCDYouTubeVideoPlayerViewController .h和.m
and added the `XCDYouTubeVideoPlayerViewController.h and .m
在viewController.m中我添加了这个方法:
In the viewController.m I've added this method:
- (IBAction) play:(id)sender
{
[self.view endEditing:YES];
NSString *link = @"m01MYOpbdIk";
XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:link];
[self presentMoviePlayerViewControllerAnimated:videoPlayerViewController];
}
目前开启和关闭 XCDYouTubeVideoPlayer
正确的方式。我做错了什么?
At the moment its opening and closing the XCDYouTubeVideoPlayer
right a way. What am i doing wrong?
推荐答案
我不明白为什么,但对我来说,在iOS8中行
I not understand why, but for me , in iOS8 the line
XCDYouTubeVideoPlayerViewController.m at #79
正在调用方法:
- (id) initWithContentURL:(NSURL *)contentURL
{
@throw [NSException exceptionWithName:NSGenericException reason:@"Use the
` initWithVideoIdentifier:` method instead." userInfo:nil];
}
我只是评论并且有效!
这篇关于XCDYouTubeVideoPlayer打开和关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!