youtube-ios-player-helper
youtube-ios-player-helper copied to clipboard
URL contains ytscframe in the path.
When the player is ready to play and starts playing, sometimes it calls this URL:
https://www.youtube.com/ytscframe
The URL is not registered in the Regex Pattern in - (BOOL)handleHttpNavigationToUrl:(NSURL *)url
, so the app goes outside. (Youtube app or Safari browser)
So, if there is an ytscframe in the path of the URL, you should cancel the loading of WKWebView as follows:
// in YTPlayerView.m
- (BOOL)handleHttpNavigationToUrl:(NSURL *)url {
// ...
if ([[[url.path stringByReplacingOccurrencesOfString:@"/" withString:@""] lowercaseString] isEqualToString:@"ytscframe"]) {
return NO;
}
// ...
}
I hope this helped if anyone was having this problem. And we hope that the issue will be fixed in the next release.
I haven't been able to reproduce this issue. Is this happening to you with a specific video? Can you provide more info to reproduce the issue?
Thank you.
@rcvrgs Hi. I haven't been able to find a path to reproduce that problem. But it happens often. Others than me seem to be experiencing the same phenomenon.
- https://www.reddit.com/r/redditmobile/comments/gssvpm/ios20201703_any_youtube_videos_that_are_played_in/
- https://www.reddit.com/r/help/comments/havlo8/youtube_opens_empty_link_when_i_click_on_a_video/