Browse Source

fix updateToolBar every 1 sec

Signed-off-by: marinofaggiana <marino@marinofaggiana.com>
marinofaggiana 3 years ago
parent
commit
86d6a3a41c

+ 1 - 1
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayer.swift

@@ -150,7 +150,7 @@ class NCPlayer: NSObject {
         
         // Evey 1 second update toolbar
         observerAVPlayertTime = player?.addPeriodicTimeObserver(forInterval: CMTimeMakeWithSeconds(1, preferredTimescale: 1), queue: .main, using: { (CMTime) in
-            if self.player?.currentItem?.status == .readyToPlay, let playerToolBar = self.playerToolBar, playerToolBar.isShow() {
+            if self.player?.currentItem?.status == .readyToPlay, let playerToolBar = self.playerToolBar {
                 self.playerToolBar?.updateToolBar()
             }
         })

+ 0 - 2
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift

@@ -156,8 +156,6 @@ class NCPlayerToolBar: UIView {
         } else {
             pipButton.setImage(NCUtility.shared.loadImage(named: "pip.enter", color: .gray), for: .normal)
             pipButton.isEnabled = false
-            pictureInPictureController = nil
-            pictureInPictureController?.delegate = nil
         }
         
         // SLIDER TIME (START - END)