Start YTPlayerView in full screen on iPad

2019-06-05 02:05发布

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

The problem is the following: on iPhone the video automatically starts in full screen while on iPad it doesn't, and I need to start it in full screen by default.

2条回答
Melony?
2楼-- · 2019-06-05 02:18

For anyone who is facing this problem, I solved it by dropping this class and using XCDYoutubeKit, it solved my issue but I had to drop the separate UI where I used my player.

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

It's also available through cocoapods

查看更多
姐就是有狂的资本
3楼-- · 2019-06-05 02:27

Add this code, so on iPhone it will not start to play on full screen:

var playerVars: NSDictionary = ["playsinline" : 1]
self.playerView.loadWithVideoId("6v2L2UGZJAM", playerVars: playerVars)
查看更多
登录 后发表回答