Closed kuldeep13990 closed 7 years ago
I feel this is more for StackOverflow rather than GitHub. However this should work for you:
XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithContentURL:[NSURL URLWithString:@"URL"]];
@JJGEight thanks for reply. but that is not working as you mentioned above, it will throw exception.
@kuldeep13990 you can just edit XCDYouTubeVideoPlayerViewController and comment out the following to stop the exception and to inherit make XCDYouTubeVideoPlayerViewController inherit from MPMoviePlayerViewController.
- (instancetype) initWithContentURL:(NSURL *)contentURL
{
@throw [NSException exceptionWithName:NSGenericException reason:@"Use the `initWithVideoIdentifier:` method instead." userInfo:nil];
} // LCOV_EXCL_LINE
Probably should have added this before, apologies.
The exception is there you tell you that you are not using XCDYouTubeVideoPlayerViewController
properly. If you already have a movie URL to play, you simply don’t need XCDYouTubeKit at all, just use an AVPlayerViewController.
I am trying to play video from amazon URL but this error occurs.
Video operation finished with error: Invalid parameters.
is it possible to play custom url rather than youtube video id?