             nowPlayingBar.addSubview(bottomDivider)
             
             nowPlayingBar.tag = playerTag
-            window.addSubview(nowPlayingBar)
+            tabbarVC.view.addSubview(nowPlayingBar)
         }
     }
     
     func showPlayerView() {
-        UIApplication.shared.keyWindow?.subviews.first(where: {$0.tag == playerTag})?.isHidden = false
+        self.tabBarController?.view.subviews.first(where: {$0.tag == playerTag})?.isHidden = false
     }
     
     func hidePlayerView() {
-        UIApplication.shared.keyWindow?.subviews.first(where: {$0.tag == playerTag})?.isHidden = true
+        self.tabBarController?.view.subviews.first(where: {$0.tag == playerTag})?.isHidden = true
     }
     
     func goToNowPlaying() {

        
        if let currentItem = playerHistoryManager.historyItems.first {
            
            guard let tabBarController = self.tabBarController else {
                return
            }
            
            let tabbarFrame = tabBarController.tabBar.frame
            let localTabbarMinY = tabBarController.view.convert(tabbarFrame, to: UIApplication.shared.keyWindow).minY
            nowPlayingBar.frame = CGRect(x: 0, y: localTabbarMinY - nowPlayingBarHeight, width: self.view.bounds.size.width, height: nowPlayingBarHeight)
            nowPlayingBar.backgroundColor = UIColor.white
            

    }
    
    func loadNowPlayingBar() { // thanks sanjeet https://stackoverflow.com/a/38157137/2608858
        guard let tabbarVC = self.tabBarController, !tabbarVC.view.subviews.contains(where: {$0.tag == playerTag}) else {
            return
        }
        
