【发布时间】:2017-10-08 16:51:43
【问题描述】:
当您使用 iphone 并在 web 视图中播放视频时,此视频会在本机播放器中全屏打开。
我们已经尝试将“allowsInlineMediaPlayback”属性设置为 true 的 UIWebView 和 WKWebView。但网页内容中的视频使用 iphone iOS 10.2 全屏启动。你知道我能做什么吗?
let webConfiguration = WKWebViewConfiguration()
// Fix Fullscreen mode for video and autoplay
webConfiguration.preferences.javaScriptEnabled = true
webConfiguration.mediaPlaybackRequiresUserAction = false
webConfiguration.allowsInlineMediaPlayback = true
webView = WKWebView(frame: CGRect(x: 0, y: 0, width:self.backgroundView.frame.width, height:self.backgroundView.frame.height), configuration: webConfiguration)
环境:Xcode 8,快速 3
【问题讨论】:
-
嗨。你得到答案了吗?
标签: iphone swift video wkwebview