|
@@ -529,7 +529,7 @@ NSString static *const kYTPlayerSyndicationRegexPattern = @"^https://tpc.googles
|
|
|
- (void)notifyDelegateOfYouTubeCallbackUrl: (NSURL *) url {
|
|
- (void)notifyDelegateOfYouTubeCallbackUrl: (NSURL *) url {
|
|
|
NSString *action = url.host;
|
|
NSString *action = url.host;
|
|
|
|
|
|
|
|
- NSLog(@"action:%@",action);
|
|
|
|
|
|
|
+ // NSLog(@"action:%@",action);
|
|
|
|
|
|
|
|
// We know the query can only be of the format ytplayer://action?data=SOMEVALUE,
|
|
// We know the query can only be of the format ytplayer://action?data=SOMEVALUE,
|
|
|
// so we parse out the value.
|
|
// so we parse out the value.
|
|
@@ -603,10 +603,7 @@ NSString static *const kYTPlayerSyndicationRegexPattern = @"^https://tpc.googles
|
|
|
{
|
|
{
|
|
|
self.webView.hidden = true;
|
|
self.webView.hidden = true;
|
|
|
}
|
|
}
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- int a=0;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
-(NSString*) Embed2VID:(NSString*) iframe_embed
|
|
-(NSString*) Embed2VID:(NSString*) iframe_embed
|
|
|
{
|
|
{
|
|
@@ -615,20 +612,20 @@ NSString static *const kYTPlayerSyndicationRegexPattern = @"^https://tpc.googles
|
|
|
NSString* content = iframe_embed;
|
|
NSString* content = iframe_embed;
|
|
|
NSString* pattern = @"(\\w+):\\/\\/([^/:]+)(:\\d*)?([^# ]*\\b)";
|
|
NSString* pattern = @"(\\w+):\\/\\/([^/:]+)(:\\d*)?([^# ]*\\b)";
|
|
|
|
|
|
|
|
- NSLog(@"content: %@",content);
|
|
|
|
|
- NSLog(@"pattern: %@",pattern);
|
|
|
|
|
|
|
+ // NSLog(@"content: %@",content);
|
|
|
|
|
+// NSLog(@"pattern: %@",pattern);
|
|
|
|
|
|
|
|
if(content==nil||pattern==nil)
|
|
if(content==nil||pattern==nil)
|
|
|
return nil;
|
|
return nil;
|
|
|
|
|
|
|
|
- NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:nil error:nil];
|
|
|
|
|
|
|
+ NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:nil];
|
|
|
|
|
|
|
|
NSTextCheckingResult *match = [regex firstMatchInString:content options:nil range:NSMakeRange(0, content.length)];
|
|
NSTextCheckingResult *match = [regex firstMatchInString:content options:nil range:NSMakeRange(0, content.length)];
|
|
|
|
|
|
|
|
int i=0;
|
|
int i=0;
|
|
|
- NSLog(@"%d->range with richtext label: %d,%d",i, [match rangeAtIndex:i].location,[match rangeAtIndex:i].length);
|
|
|
|
|
|
|
+ // NSLog(@"%d->range with richtext label: %d,%d",i, [match rangeAtIndex:i].location,[match rangeAtIndex:i].length);
|
|
|
// NSLog(@"%d-> range of text: %d,%d ",i+1, [match rangeAtIndex:i+1].location,[match rangeAtIndex:i+1].length);
|
|
// NSLog(@"%d-> range of text: %d,%d ",i+1, [match rangeAtIndex:i+1].location,[match rangeAtIndex:i+1].length);
|
|
|
- NSLog(@"text: %@ ",[content substringWithRange:[match rangeAtIndex:i]]);
|
|
|
|
|
|
|
+ // NSLog(@"text: %@ ",[content substringWithRange:[match rangeAtIndex:i]]);
|
|
|
|
|
|
|
|
return [[content substringWithRange:[match rangeAtIndex:i]] lastPathComponent];
|
|
return [[content substringWithRange:[match rangeAtIndex:i]] lastPathComponent];
|
|
|
}
|
|
}
|