UIWebview中出现两个视频播放器

时间:2019-02-19 03:56:29

标签: ios swift uiwebview

为什么当我播放视频时,有两个重叠的视频播放器。有人可以告诉我为什么以及如何解决吗?

import UIKit

class ViewController: UIViewController,UIWebViewDelegate,UIScrollViewDelegate {
    @IBOutlet weak var webview: UIWebView!

    override func viewDidLoad() {
        super.viewDidLoad()
        if let mediaURL:URL = URL(string: "https://twitter.com/") {
            let request:URLRequest = URLRequest(url: mediaURL)
            webview.allowsInlineMediaPlayback = false
            DispatchQueue.main.async {
                 self.webview.loadRequest(request)
            }
        }
    }

    func webViewDidFinishLoad(_ webView: UIWebView) {

    }
}

This is the video image I took

0 个答案:

没有答案