bdalziel
bdalziel

Reputation: 2005

iOS YouTube Video layout issue - margin above player

iOS YouTube Helper Library, vanilla setup, outlet view in storyboard is a YTPlayerView, and I load a video in like this:

[self.playerView loadWithVideoId:@"9NPEj63d0jY"];

I added a background color to the view (black), and the webview created in YTPlayerView (red). You can see that it's mispositioning the content within the webview, hence the red margin at the top.

Incorrectly positioned video within view

It doesn't get much more basic than this setup:

Simple Universal Storyboard setup

Can anyone spot anything I'm doing wrong, or suggest a workaround? I've been unable to debug the webview using Safari to inspect the simulator.

Upvotes: 0

Views: 640

Answers (1)

bdalziel
bdalziel

Reputation: 2005

I ended up modifying the youtube helper - fork available here:

https://github.com/SlyTrunk/youtube-ios-player-helper

This is the interesting part for this bug, I believe: https://github.com/SlyTrunk/youtube-ios-player-helper/commit/68f042fad915d22abce79d9523a9dab098c81c03#diff-1300977cb1cb9b838b0506efbbc486b6L612

Upvotes: 1

Related Questions