gilesvangruisen / Swift-YouTube-Player

Swift library for embedding and controlling YouTube videos in your iOS applications via WKWebView!
MIT License
874 stars 282 forks source link

Full Screen #118

Open MonaHammad opened 7 years ago

MonaHammad commented 7 years ago

I can't play videos on full screen as before, any advice?

begimai commented 7 years ago

++

johnnelm9r commented 6 years ago

My videos still play in fullscreen on iPhone but it wasn't playing fullscreen on iPad. I had to make a change in YouTubePlayer.swift. If you change allowsInlineMediaPlayback to false in this section:

fileprivate func buildWebView(_ parameters: [String: AnyObject]) { webView = UIWebView() webView.allowsInlineMediaPlayback = false webView.mediaPlaybackRequiresUserAction = false webView.delegate = self webView.scrollView.isScrollEnabled = false }

it will now play in fullscreen on iPad. Or at least it is working at the time of writing this. I hope that helps.