     }
 
     deinit {
-    }
-    
-}
+        self.player?.pause()
+        self.player = nil
+    }
+    
+}

    public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
        self._avplayer = AVPlayer()
        self._avplayer.actionAtItemEnd = .pause
        
        self.playbackFreezesAtEnd = false
        self.playbackPausesWhenBackgrounded = true
        self.playbackResumesWhenEnteringForeground = true
        
        self._timeObserver = nil
        
        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)

        if Thread.isMainThread {
            closure()
        } else {
            DispatchQueue.main.async(execute: closure)
        }
    }
    
