1

In my app, I'm using the YTPlayerView to show a youtube video. I have set the parameters of the player so that the video is displayed in fullscreen. Now I have a new test device (iPhone XR with iOS 12.1) where the video is usually not displayed in full screen. I tested other parameters without any other result. On an other iOS 12.1 device or with older iOS-versions the video is displayed in fullscreen correctly.

self.playerView = [[YTPlayerView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, f_frameHeight)];

self.playerView.delegate = self;

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(exitedFullScreen:)  name:UIWindowDidBecomeHiddenNotification object:nil];

NSDictionary *playerVars = @{
                             @"playsinline" : @0,
                             @"autoplay" : @1,
                             @"rel" : @0,
                             @"showinfo" : @0,
                             };
[self.playerView loadWithVideoId:ns_videoID playerVars:playerVars];

[self.view addSubview:self.playerView];

Has anyone the same problem or an idea what's could be the problem?

Shamim Hossain
  • 1,690
  • 12
  • 21
Henning
  • 421
  • 2
  • 11
  • 22

1 Answers1

0

youtube is not supporting the "rel" nor "showinfo" parameters anymore, refer here : https://developers.google.com/youtube/player_parameters#rel , if you take out that parameters I think your code will work.

Shenging
  • 11
  • 1
  • I have removed both parameters. So I only have autoplay = 1 and playsinline = 0. Unfortunately, there is still no change to the automatic full screen. I get the full screen only when I press the corresponding button. – Henning Dec 10 '18 at 09:41