title: Detect file streaming finished and ready to play with avplayer
body: <p>I am playing audio file from remote server with avplayer. When i play this, first avplayer stream from the url and then play the file. Now I just want to detect when file streaming is finished and started to play. </p>
  
  <p>Here is my code: </p>
  
  <pre><code>try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback)
  
  player = AVPlayer(url: down_url)
  player.addObserver(self, forKeyPath: "status", options: NSKeyValueObservingOptions.new, context: nil)
  player.volume = 1.0
  player.play()
  
  
  override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
      if keyPath == "rate" {
          if player.rate &gt; 0 {
              print("player started")
          }
      }
  }
  </code></pre>
  
  <p>I used this code to detect but it print "player started" only once when avplayer started to streaming. But i can't detect when avplayer started to play.</p>