I am trying to insert a video with html in swift below is my current code and a picture below.
import UIKit
import AVFoundation
import AVKit
class video: UIViewController {
@IBOutlet weak var z: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
let fileURL = NSURL(fileURLWithPath: "/Users/zman/Desktop/x.mp4")
z.loadHTMLString("<iframe width = \" \(self.z.frame.width) \"height = \"\(self.z.frame.height)\"src = \"\(fileURL)\"></ifrmae>", baseURL: nil)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
You can see the white space of the left side of the video when it loads. I would like to use a tight fight on it so that you cant see any white space. I would like to my video W3Schools Tryit Editor. To look live the video in the link. Is it possible to use the same html on the w3 link in swift.