 
     public var minimumBufferDuration: Double = 5.0
 
-    public weak var delegate: KKPlayerViewControllerDelegate?
+    public weak var delegate: KKPlayerViewControllerDelegate? {
+
+        didSet {
+
+            if #available(iOS 9.0, *) {
+
+                self.avPlayerViewController.delegate = self.delegate
+            }
+        }
+    }
 
     // MARK: Private properties
 


        self.backgroundColor = UIColor.blackColor()

        if #available(iOS 9.0, *) {

            self.avPlayerViewController.delegate = self.delegate
        }

        self.avPlayerViewController.addObserver(
            self,
            forKeyPath: avPlayerViewControllerReadyForDisplayKey,

    private var playerItem: AVPlayerItem?

    // AVPlayerViewController.player paused by AVPlayerViewController when going into the background.
    // So, on the background, remove the reference from AVPlayerViewController.
    private var player: AVPlayer? {

        didSet {
