title: Using AVPlayer for streaming is slow
body: <p>I use AVPlayer for streaming mp3 file from the internet and it works really slow. Using profiler I found out, that it downloads entire file at first, and then starts playing. Is there any workaround for this?</p>
  
  <p>Right now, I'm using this code </p>
  
  <pre><code>if let player = player {
      NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: player.currentItem)
  
      let item = AVPlayerItem(url: url)
  
      player.replaceCurrentItem(with: item)
  } else {
      player = AVPlayer(url: url)
  }
  player?.play()
  </code></pre>
  
  <p>Things I've tried:</p>
  
  <ul>
  <li>move player?.play() to an observer, attached to <em>status</em> property of the item</li>
  <li>play around with properties <em>preferredForwardBufferDuration</em> and <em>preferredPeakBitRate</em></li>
  </ul>
  
  <p>All the time the result is downloading a whole audio file and only then start of playing. </p>
  
  <p>Please note, the issue is - player starts to play ONLY after the whole file was downloaded, while I want it to stream mp3.</p>