Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion LBYouTubeView/LBYouTubeExtractor.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ -(void)didSuccessfullyExtractYouTubeURL:(NSURL *)videoURL {
}

-(void)failedExtractingYouTubeURLWithError:(NSError *)error {

NSLog(@"Failed to query mp4: %@", error);
if (self.delegate) {
[self.delegate youTubeExtractor:self failedExtractingYouTubeURLWithError:error];
}

if(self.completionBlock) {
self.completionBlock(nil, error);
}
Expand Down
22 changes: 17 additions & 5 deletions LBYouTubeView/LBYouTubePlayerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,24 @@ -(id)initWithYouTubeID:(NSString *)youTubeID quality:(LBYouTubeVideoQuality)qual
#pragma mark LBYouTubeExtractorDelegate

-(void)youTubeExtractor:(LBYouTubeExtractor *)extractor didSuccessfullyExtractYouTubeURL:(NSURL *)videoURL {
if ([self.delegate respondsToSelector:@selector(youTubePlayerViewController:didSuccessfullyExtractYouTubeURL:)]) {
[self.delegate youTubePlayerViewController:self didSuccessfullyExtractYouTubeURL:videoURL];

NSURL *candidateURL = videoURL;
if (candidateURL && candidateURL.scheme && candidateURL.host)
{
if ([self.delegate respondsToSelector:@selector(youTubePlayerViewController:didSuccessfullyExtractYouTubeURL:)]) {
[self.delegate youTubePlayerViewController:self didSuccessfullyExtractYouTubeURL:videoURL];
}

self.moviePlayer.contentURL = videoURL;
[self.moviePlayer play];
}
else
{
NSLog(@"extracted URL is buggy: %@", videoURL);
if ([self.delegate respondsToSelector:@selector(youTubePlayerViewController:failedExtractingYouTubeURLWithError:)]) {
[self.delegate youTubePlayerViewController:self failedExtractingYouTubeURLWithError:nil];
}
}

self.moviePlayer.contentURL = videoURL;
[self.moviePlayer play];
}

-(void)youTubeExtractor:(LBYouTubeExtractor *)extractor failedExtractingYouTubeURLWithError:(NSError *)error {
Expand Down