I also got into this problem, and maybe here is a possible solution.
I donβt know why, but with loadWithVideoId used with the next and previous buttons in MPRemoteCommandCenter , the application crashes when I try to load the next or previous video.
So, I changed loadWithVideoId to loadPlaylistByVideos and it seems to work. In your case, you can try:
Start up PlayerView with playerVars first:
NSDictionary *playerVars = @{ @"controls" : @1, @"playsinline" : @1, @"autohide" : @1, @"modestbranding" : @1, @"showinfo" : @1 }; [self.playerView loadWithPlayerParams:playerVars];
And then upload the video using the loadPlaylistByVideos method:
[self.playerView loadPlaylistByVideos:@[@"LlrY456zAMU"] index:0 startSeconds:0 suggestedQuality:kYTPlaybackQualityMedium];
Finally, to load the next or previous video, call the methods:
[self.playerView previousVideo]
or
[self.playerView nextVideo]
Hope this helps!
jos May 24 '16 at 8:37 a.m. 2016-05-24 08:37
source share