title: m3u8 file doesnt play in iOS
body: <p>Hello I want to play m3u8 file using swift. My m3u8 file structure is like this.</p>
  
  <pre><code>#EXTM3U
  
  #EXT-X-VERSION:3
  
  #EXT-X-STREAM- INF:BANDWIDTH=814508,CODECS="avc1.66.51,mp4a.40.34",RESOLUTION=720x576 chunklist_w247403833.m3u8
  </code></pre>
  
  <p>But this is not playing. But if I used apple sample m3u8 file in <a href="http://devstreaming.apple.com/videos/wwdc/2016/102w0bsn0ge83qfv7za/102/hls_vod_mvp.m3u8" rel="nofollow noreferrer">here</a> its playing. but above m3u8 file is playing in android app and windows vlc player too. What would be the reason for this? Please help me.
  Thanks</p>
  
  <p><strong>code</strong></p>
  
  <pre><code> let videoURL = NSURL(string: "http://74.208.128.124:1935/live/myStream/playlist.m3u8")//http://devstreaming.apple.com/videos/wwdc/2016/102w0bsn0ge83qfv7za/102/hls_vod_mvp.m3u8
      let player = AVPlayer(url: videoURL! as URL)
      let playerLayer = AVPlayerLayer(player: player)
      playerLayer.frame = self.view.bounds
      self.view.layer.addSublayer(playerLayer)
      player.play()
  }
  </code></pre>
  
  <p><strong>Adding KVO</strong></p>
  
  <pre><code> override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
     if keyPath=="status"
     {
        if(player.status==AVPlayerStatus.readyToPlay)
        {
          print(player.status)
        }
      else if(player.status==AVPlayerStatus.failed)
        {
          print("ERROR-----------", player.status)
        }
  
     }
  }
  </code></pre>