YTPlayerViewの次のボタンと前のボタンのクリックでYouTubeビデオを変更して再生したい。単一のビデオを再生できますが、次のボタンと前のボタンのクリックでビデオを変更したい場合。
以下のコードを使用して、単一のビデオを再生しました。
NSDictionary *playerVars = @{
@"controls" : @1,
@"playsinline" : @1,
@"autohide" : @1,
@"modestbranding" : @1,
@"origin" : @"https://www.example.com",
@"showinfo" : @1
};
[self.youtube_playerView loadWithVideoId:@"LlrY456zAMU" playerVars:playerVars];
self.youtube_playerView.delegate=self;
上記のコードは完全に機能します。複数のビデオを再生するために以下のコードを使用している場合、エラーが発生しました エラーが発生しました.再試行してください 文字再生 id:LlrY456zAMU and video could not play.:
[self.youtube_playerView loadPlaylistByVideos:@[@"LlrY456zAMU",@"96ReVjMAXEE"]
index:0
startSeconds:0
suggestedQuality:kYTPlaybackQualityMedium];
[self.youtube_playerView loadWithPlayerParams:playerVars];
self.youtube_playerView.delegate=self;