title: How to play video in ios swift
body: <p>I am new to ios programming, actually I need to stream video URL but i am unable to stream video URL using avplayer, but using avplayer downloaded file i am able to play.Actual problem is my file format is different 
  for example my file name is like this  song.apa but it is song.mp4</p>
  
  <p>code:</p>
  
  <pre><code>let avplayerController = AVPlayerViewController()
  var avPlayer:AVPlayer?
  
  override func viewDidLoad()
  {
      super.viewDidLoad()
      let movieUrl = URL.init(string: "http://techslides.com/demos/sample-videos/small.3gp")
      self.avPlayer = AVPlayer.init(url: movieUrl!)
      self.avplayerController.player = self.avPlayer
  }
  
  override func didReceiveMemoryWarning()
  {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
  @IBAction func playVideo(_ sender: Any)
  {
      self.present(self.avplayerController, animated: true) { 
       self.avplayerController.player?.play()
      }
  }
  </code></pre>