youtube-ios-player-helperライブラリを使用して YouTube 動画を再生しようとしていますが、実行時に次のエラーが発生します。
Received error rendering template: Error Domain=NSCocoaErrorDomain Code=258 "The operation couldn't be completed. (Cocoa error 258.)"
youtube-ios-player-helperライブラリを使用して YouTube 動画を再生しようとしていますが、実行時に次のエラーが発生します。
Received error rendering template: Error Domain=NSCocoaErrorDomain Code=258 "The operation couldn't be completed. (Cocoa error 258.)"
YTPlayerView.m 内
編集:
NSString *path = [[NSBundle mainBundle] pathForResource:@"YTPlayerView-iframe-player"
ofType:@"html"
inDirectory:@"Assets"];
に:
NSString *path = [[NSBundle mainBundle] pathForResource:@"YTPlayerView-iframe-player"
ofType:@"html"];
お役に立てれば幸いです。
この問題を解決するには、Assets/YTPlayerView-iframe-player.html をメイン バンドルにコピーする必要があります。
または単にバンドルに入れて、アプリが探し始める場所を置き換えます
/*NSString *path = [[NSBundle mainBundle] pathForResource:@"YTPlayerView-iframe-player"
ofType:@"html"
inDirectory:@"Assets"];*/
NSString *path = [[NSBundle mainBundle] pathForResource:@"YTPlayerView-iframe-player" ofType:@"html"];
問題のあるプラグインのバージョンを提供していません。これが 1.5 の場合、ここで説明されているバグがあります: https://github.com/youtube/youtube-ios-player-helper/issues/160。
マスターではすでに修正されているため、Cocoapods を使用していると仮定すると、次のようにすることができます。
pod 'youtube-ios-player-helper', :git=>'https://github.com/youtube/youtube-ios-player-helper', :commit=>'head'