youtube / youtube-ios-player-helper

Lightweight helper library that allows iOS developers to add inline playback of YouTube videos through a WebView
Other
1.65k stars 683 forks source link

White screen when adding it without outlet #119

Open kmiloaguilar opened 9 years ago

kmiloaguilar commented 9 years ago

I'm using it without IBOutlet and doing something like this:

_playerView = [[YTPlayerView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.width/kVideoRatio)];

And if I add the _playerView to the view of the controller it appears a white screen. Can in a certain way fix this? It takes a while to show the player. Maybe having a way to load the player without any video, just the mockup.

JALsnipe commented 9 years ago

You can roll your own solution. Take an image of an empty player in a UIImageView and show that until the video starts buffering or playing, then remove the image view and show the player. You can use the didChangeToState: delegate.

HaloZero commented 8 years ago

I believe this is fixed by https://github.com/youtube/youtube-ios-player-helper/pull/153