60
60
NSString static *const kYTPlayerAdUrlRegexPattern = @" ^http(s)://pubads.g.doubleclick.net/pagead/conversion/" ;
61
61
NSString static *const kYTPlayerOAuthRegexPattern = @" ^http(s)://accounts.google.com/o/oauth2/(.*)$" ;
62
62
NSString static *const kYTPlayerStaticProxyRegexPattern = @" ^https://content.googleapis.com/static/proxy.html(.*)$" ;
63
+ NSString static *const kYTPlayerSyndicationRegexPattern = @" ^https://tpc.googlesyndication.com/sodar/(.*).html$" ;
63
64
64
65
@interface YTPlayerView ()
65
66
@@ -621,6 +622,16 @@ - (BOOL)handleHttpNavigationToUrl:(NSURL *) url {
621
622
[adRegex firstMatchInString: url.absoluteString
622
623
options: 0
623
624
range: NSMakeRange (0 , [url.absoluteString length ])];
625
+
626
+ NSRegularExpression *syndicationRegex =
627
+ [NSRegularExpression regularExpressionWithPattern: kYTPlayerSyndicationRegexPattern
628
+ options: NSRegularExpressionCaseInsensitive
629
+ error: &error];
630
+
631
+ NSTextCheckingResult *syndicationMatch =
632
+ [syndicationRegex firstMatchInString: url.absoluteString
633
+ options: 0
634
+ range: NSMakeRange (0 , [url.absoluteString length ])];
624
635
625
636
NSRegularExpression *oauthRegex =
626
637
[NSRegularExpression regularExpressionWithPattern: kYTPlayerOAuthRegexPattern
@@ -640,7 +651,7 @@ - (BOOL)handleHttpNavigationToUrl:(NSURL *) url {
640
651
options: 0
641
652
range: NSMakeRange (0 , [url.absoluteString length ])];
642
653
643
- if (ytMatch || adMatch || oauthMatch || staticProxyMatch) {
654
+ if (ytMatch || adMatch || oauthMatch || staticProxyMatch || syndicationMatch ) {
644
655
return YES ;
645
656
} else {
646
657
[[UIApplication sharedApplication ] openURL: url];
0 commit comments