Launch YTPlayerView in full screen on iPad

I am using the iOS class of the YTPlayerView class, which is provided by Youtube, and you can check it here .

The problem is this: on the iPhone, the video automatically starts in full screen mode, but on the iPad it does not, and I need to run it in full screen by default.

+1
source share
2 answers

For those who are facing this problem, I solved it by dropping this class and using XCDYoutubeKit, it solved my problem, but I had to abandon the separate interface where I used the player.

https://github.com/0xced/XCDYouTubeKit

It is also available through cocoapods.

+1
source

Add this code so that on the iPhone it will not start playing in full screen mode:

var playerVars: NSDictionary = ["playsinline" : 1] self.playerView.loadWithVideoId("6v2L2UGZJAM", playerVars: playerVars) 
0
source

All Articles