ios - Disable Youtube autoplay in WkWebView

2020-03-30 07:34发布

I'm using WKWebView to open pages in Youtube. Problem is that on opening they start playing videos and go fullscreen, which is not wanted behavior. Videos are not embeded, it's whole pages with description, comments etc..

Is there a way to stop them playing?

1条回答
啃猪蹄的小仙女
2楼-- · 2020-03-30 08:00

It works. Please read comments.

import UIKit
import WebKit
import RxSwift

class WebViewController: UIViewController {

    let webview: WKWebView

    init() {
        //                                                                     
查看更多
登录 后发表回答