Henning
Henning

Reputation: 491

iOS - Problem with YouTube api and fullscreen

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?

Upvotes: 1

Views: 753

Answers (1)

Shenging
Shenging

Reputation: 11

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.

Upvotes: 0

Related Questions