Created
September 26, 2018 20:13
-
-
Save aguilarpgc/44c10a42d4d16656e7c0396a018c0531 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| import WebKit | |
| class ViewController: UIViewController { | |
| @IBOutlet weak var webContainer: UIView! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| let url = URL(string: "...") | |
| let configuration = WKWebViewConfiguration() | |
| configuration.allowsInlineMediaPlayback = true | |
| configuration.mediaTypesRequiringUserActionForPlayback = [] | |
| let webview = WKWebView(frame: webContainer.bounds, configuration: configuration) | |
| webview.load(URLRequest(url: url!)) | |
| webContainer.addSubview(webview) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment