youtube / youtube-ios-player-helper

Lightweight helper library that allows iOS developers to add inline playback of YouTube videos through a WebView
Other
1.65k stars 683 forks source link

Youtube player view failed when add use_frameworks! to cocoapods #249

Open Tayphoon opened 7 years ago

Tayphoon commented 7 years ago

I receive error when try to load video to YTPlayerView: Received error rendering template: Error Domain=NSCocoaErrorDomain Code=258. This is because when you add use_frameworks! all pods located in separate frameworks and YTPlayerView-iframe-player.html have different path. Please use this code when you try to load framework bundle:

NSBundle * bundlePath = [NSBundle bundleWithIdentifier:@"org.cocoapods.youtube-ios-player-helper"];
NSString * frameworkBundlePath = [bundlePath pathForResource:@"Assets" ofType:@"bundle"];
frameworkBundle = [NSBundle bundleWithPath:frameworkBundlePath];
brol1dev commented 2 years ago

According to https://blog.cocoapods.org/CocoaPods-0.36/ and https://stackoverflow.com/questions/41210249/why-do-we-use-use-frameworks-in-cocoapods the issue is not relevant anymore. Now use_frameworks! is added by default and we haven't experienced issues in the recent years related to it.

I'm closing the issue but feel free to re-open if you still see it is happening.