0

I am using YTPlayerView for playing embedded videos in my app. Everything works perfect with ID but video doesn't play with URL. Here is my code

-(IBAction)playVideo:(id)sender{
    self.playerView.delegate = self;
    self.playerView.hidden = false;
    [self.playerView loadVideoByURL:@"https://www.youtube.com/watch?v=KWTULSf29Ho" startSeconds:0 suggestedQuality:kYTPlaybackQualitySmall];
}
GameFreak
  • 63
  • 8
  • https://github.com/youtube/youtube-ios-player-helper/issues/168 –  Feb 19 '17 at 19:04
  • The URL has to be in the format http://www.youtube.com/v/VIDEO_ID?version=3, your url was wrong. – Mistrx丶 Feb 20 '17 at 01:44
  • This is normal url we will have from our user inputed. How can we achieve that specific format ? – GameFreak Feb 20 '17 at 05:32
  • No success :( [self.playerView loadVideoByURL:@"https://www.youtube.com/watch?v=KWTULSf29Ho?version=3" startSeconds:0 suggestedQuality:kYTPlaybackQualitySmall]; – GameFreak Feb 20 '17 at 16:29

1 Answers1

0

The URL has to be in the format youtube.com/v/VIDEO_ID?version=3, your url was wrong.

if you want to achieve the specific format, change your method which for responding user input url, appending ?version=3 with user input url. enter image description here

check this,i think you forgot load the video into the player

Mistrx丶
  • 267
  • 3
  • 10