I have a UIWebView subclass that I used to play both youtube and local videos. Worked perfectly under iOS6. In upgrading to iOS7 I\'ve encountered a problem I don\'t really kn
YouTube has made available a framework to save us from the hassle of using a web view directly. The framework is available at: https://github.com/youtube/youtube-ios-player-helper
All you need to do is to create a YTPlayerView view, add it to the view hierarchy with the constraints you like and load the video. Like so:
youTubePlayer = YTPlayerView()
youTubePlayer!.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(youTubePlayer!)
youTubePlayer!.pinAllAnchors(to: contentView)
youTubePlayer!.load(withVideoId: url.youTubeVideoId()!)
Note that pinAllAnchors and youTubeVideoId are helpers I created. They are not part of the framework.