title: How do i make a looping video in swift
body: <p>How would i go about making a local <code>.mp4</code> file with no sound play on a loop, so it would only take up part of the screen and have no user controls. Just a looping video, sort of like a gif. I am using <code>xcode</code>, <code>swift2</code>.</p>
  
  <pre><code>class ViewController: UIViewController {
  
      var playerViewController = AVPlayerViewController()
      var playerView = AVPlayer()
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
  
      }
  
      override func viewDidAppear(animated: Bool) {
          var fileURL = NSURL(fileURLWithPath: "/Users/Mantas/Desktop/123/123/video-1453562323.mp4.mp4")
          playerView = AVPlayer(URL: fileURL)
  
          playerViewController.player = playerView
  
          self.presentViewController(playerViewController, animated: true){
  
              self.playerViewController.player?.play()
  
          }
      }
  }
  </code></pre>
  
  <p>I have made this, it plays the video, but in full screen, i dont know how to make it only take up part of the screen and how to make it loop</p>