13

youtube-ios-player-helperライブラリを使用して YouTube 動画を再生しようとしていますが、実行時に次のエラーが発生します。

Received error rendering template: Error Domain=NSCocoaErrorDomain Code=258 "The operation couldn't be completed. (Cocoa error 258.)"
4

4 に答える 4

40

YTPlayerView.m 内

編集:

NSString *path = [[NSBundle mainBundle] pathForResource:@"YTPlayerView-iframe-player"
                                                 ofType:@"html"
                                            inDirectory:@"Assets"];

に:

NSString *path = [[NSBundle mainBundle] pathForResource:@"YTPlayerView-iframe-player"
                                                 ofType:@"html"];

お役に立てれば幸いです。

于 2014-05-23T10:52:33.080 に答える
6

この問題を解決するには、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"];
于 2014-11-09T11:20:31.343 に答える
-1

問題のあるプラグインのバージョンを提供していません。これが 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'
于 2016-03-03T15:43:08.173 に答える