I am trying to play a YouTube video with the youtube-ios-player-helper library, but I am encountering an error at runtime:
Received error rendering template: Error Domain=NSCocoaErrorDomain Code=258 "The operation couldn't be completed. (Cocoa error 258.)"
The youtube-ios-player-helper is an open source library that helps you embed a YouTube iframe player into an iOS application.
In YTPlayerView.m
Edit:
NSString *path = [[NSBundle mainBundle] pathForResource:@"YTPlayerView-iframe-player"
ofType:@"html"
inDirectory:@"Assets"];
To:
NSString *path = [[NSBundle mainBundle] pathForResource:@"YTPlayerView-iframe-player"
ofType:@"html"];
Hope to help you!
You need copy Assets/YTPlayerView-iframe-player.html to main bundle to fix this issue.
or just put into bundle, and replace where App starts to look for
/*NSString *path = [[NSBundle mainBundle] pathForResource:@"YTPlayerView-iframe-player"
ofType:@"html"
inDirectory:@"Assets"];*/
NSString *path = [[NSBundle mainBundle] pathForResource:@"YTPlayerView-iframe-player" ofType:@"html"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With