# How to insert html in x code

**URL:** <https://forums.kodeco.com/t/how-to-insert-html-in-x-code/19827>\
**Category:** Swift\
**Created:** [September 15, 2016, 2:34pm UTC](https://forums.kodeco.com/t/how-to-insert-html-in-x-code/19827 "2016-09-15T14:34:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zalubski](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/zalubski/32/81494_2.png) [@zalubski](https://forums.kodeco.com/u/zalubski)\
**Post date:** [September 15, 2016, 2:34pm UTC](https://forums.kodeco.com/t/how-to-insert-html-in-x-code/19827/1 "2016-09-15T14:34:36Z")

</div>

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.
}
}

```

 ![](https://raywenderlich-com-v3-forums.s3.amazonaws.com/original/3X/2/5/25ec5c5a1b2695ac692bdde50452c15cbcaf6a7b.png)

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](http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_video_all). To look live the video in the link. Is it possible to use the same html on the w3 link in swift.
