我有一个小应用程序。我正在网络视图中打开YouTube并观看视频。一切都很好,但是当我单击视频时,它会打开新页面并自动全屏启动视频。我不想自动开始播放视频。
我该怎么做?
我的代码:
let conf = WKWebViewConfiguration()
conf.allowsInlineMediaPlayback = false //Tried and Did not work
conf.requiresUserActionForMediaPlayback = true //Tried and Did not work
super.init(frame: CGRect.zero, configuration: conf)
试试吧 conf.allowsInlineMediaPlayback = true .