title: Impossible to stop AVPlayer
body: <p>I am currently testing the use of AVPlayer with audio streaming url, using <strong>Swift</strong>. There are <a href="https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVPlayer_Class/index.html#//apple_ref/occ/instm/AVPlayer/play" rel="noreferrer">play()</a> and <a href="https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVPlayer_Class/index.html#//apple_ref/occ/instm/AVPlayer/pause" rel="noreferrer">pause()</a> methods, but the problem is that, pausing only, the stream remains cached in the device.</p>
  
  <p>Here is my test code :</p>
  
  <pre><code>import UIKit
  import AVFoundation
  
  class ViewController: UIViewController {
  
      let player = AVPlayer(URL: NSURL(string: "http://streaming.radio.rtl.fr/rtl-1-48-192")!)
  
      @IBOutlet weak var btnPlay: UIButton!
  
      override func viewDidLoad() {
          super.viewDidLoad()            
      }
  
      @IBAction func btnPress(sender: AnyObject) {
          if (btnPlay.titleLabel?.text == "Play") {
              initPlayer()
              btnPlay.setTitle("Stop", forState: UIControlState.Normal)
          } else {
              stopPlayer()
              btnPlay.setTitle("Play", forState: UIControlState.Normal)
          }
      }
  
      func initPlayer()  {
          player.play()
      }
  
      func stopPlayer() {
          // player.currentItem = nil // Last thing I tried, but generate an error
          player.pause()
      }
  }
  </code></pre>
  
  <p><strong>Here are the issues when trying somethings :</strong></p>
  
  <p><code>player = nil</code> : "Cannot assign a value of type 'NilLiteralCOnvertible' to a value of type 'AVPlayer'"</p>
  
  <p><code>player.currentItem = nil</code> : "Cannot assign to property: 'currentItem' is a get-only property"</p>
  
  <hr>
  
  <p>I tried everything, even through <a href="https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVQueuePlayer_Class/index.html" rel="noreferrer">AVQueuePlayer</a> without any effective result. (obviously, since I only have one item in my case).</p>
  
  <p>How to <strong>stop AVPlayer</strong> or <strong>destroy his instance</strong> ?</p>