2

I want to change and play youtube video on next and previous button click of YTPlayerView. I'm able to play single video but when But I want to change video on next and previous button click.

I played single video using this below code :

 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;

Above code works perfectly. If I'm using this below code for play multiple video, then got an error An error occurred.Please try again letter playback id:LlrY456zAMU and video could not played.:

[self.youtube_playerView loadPlaylistByVideos:@[@"LlrY456zAMU",@"96ReVjMAXEE"]
                                    index:0
                             startSeconds:0
                         suggestedQuality:kYTPlaybackQualityMedium];
[self.youtube_playerView loadWithPlayerParams:playerVars];
self.youtube_playerView.delegate=self;
Monika Patel
  • 2,287
  • 3
  • 20
  • 45
  • I think that wont possible :( – Nitin Gohel Jun 02 '16 at 11:26
  • its old question but lemme say something. i haven't tried cus i'm on my phone but you can [check it out](http://stackoverflow.com/a/39869043/3308174), will get back when i build a demo so someone could find a way.. – Pratik Jamariya Jan 11 '17 at 18:22

0 Answers0