0

YouTube player update allow vertical video can display fullscreen in vertical mode. I was asked to fit YouTube video in a vertical view (not a full screen mode) in our iOS app.

We use YTPlayerView to playing YouTube video, but it doesn't provide any method to check if a video is vertical. I guess we can query such the info from YouTube web API, but I couldn't find any thing.

Has anyone tried to do the same thing like mine?

JAL
  • 41,701
  • 23
  • 172
  • 300
jAckOdE
  • 2,402
  • 8
  • 37
  • 67
  • Vertical Mode was just released in last Youtube iOS app update, and there is (still) no official API from Youtube (and I could not find any unofficial API either). – aramusss Jul 31 '15 at 07:43

1 Answers1

0

If it's not fullscreen mode then:

NSDictionary *playerVars = @{
                             @"playsinline" : @1,
                             };
[self.playerView loadWithVideoId:@"VIDEO_ID" playerVars:playerVars];

Just adjust the view's position etc, it will play just fine. Edit the html file they provide so the background matches your app's etc if you don't like the black.

Jake Armstrong
  • 569
  • 4
  • 21