Currently I am making an iOS app which involves playing YouTube videos. I chose to use the official YouTube iOS Player Helper, which provides a mechanism to play YouTube videos with an URL.
Since the appearance which came with it did not fit the application's theme, I decided to load the thumbnails in a UIImageView and add a hidden YTPlayerView at the centre of the image view. (I can't grant that this is the cause of the problem)
However, here comes a problem: whenever I pause the video, unlike playing videos in Safari, the video turns blank, but it continues to play normally after I hit play again. Sometimes(rarely) my videos will start off with a blank screen with sound, but after a pause and a play, graphic comes back.
Info might be helpful to solve this problem:
I have created a singleton class where there's a function which accepts two parameters: videoID: String and onView: UIView. There is a stored property player: YTPlayerView declared, and whenever user quits the full screen mode, this player property is immediately set to another YTPlayerView instance, just to let ARC to destroy the old one so that it doesn't conflict with my music player in MPNowPlayingCenter any more.
On a simulator, but not a real device, all videos are immediately paused after first opened and started playing (I monitored the player state using delegate). After that pause, no more automatic pauses, but the issue described above still exists.