浏览代码

Test

Signed-off-by: marinofaggiana <marino@marinofaggiana.com>
marinofaggiana 3 年之前
父节点
当前提交
b2fb4d7671

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

@@ -157,7 +157,7 @@ class NCPlayer: NSObject {
                 if !(self.detailView?.isShow() ?? false) {
                 if !(self.detailView?.isShow() ?? false) {
                     NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterShowPlayerToolBar, userInfo: ["ocId":metadata.ocId, "enableTimerAutoHide": false])
                     NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterShowPlayerToolBar, userInfo: ["ocId":metadata.ocId, "enableTimerAutoHide": false])
                 }
                 }
-                self.playerToolBar?.updateToolBar(timeSeek: .zero)
+                self.playerToolBar?.updateToolBar()
             }
             }
         }
         }
         
         

+ 3 - 9
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift

@@ -136,10 +136,9 @@ class NCPlayerToolBar: UIView {
         updateToolBar()
         updateToolBar()
     }
     }
     
     
-    public func updateToolBar(timeSeek: CMTime? = nil) {
+    public func updateToolBar() {
         guard let metadata = self.metadata else { return }
         guard let metadata = self.metadata else { return }
         guard let ncplayer = self.ncplayer else { return }
         guard let ncplayer = self.ncplayer else { return }
-        var time: CMTime = .zero
                 
                 
         // MUTE
         // MUTE
         if CCUtility.getAudioMute() {
         if CCUtility.getAudioMute() {
@@ -167,12 +166,7 @@ class NCPlayerToolBar: UIView {
         }
         }
         
         
         // SLIDER TIME (START - END)
         // SLIDER TIME (START - END)
-        if timeSeek != nil {
-            time = timeSeek!
-        } else {
-            time = (ncplayer.player?.currentTime() ?? .zero).convertScale(1000, method: .default)
-            
-        }
+        let time = (ncplayer.player?.currentTime() ?? .zero).convertScale(1000, method: .default)
         playbackSlider.value = Float(time.seconds)
         playbackSlider.value = Float(time.seconds)
         MPNowPlayingInfoCenter.default().nowPlayingInfo?[MPNowPlayingInfoPropertyElapsedPlaybackTime] = time.seconds
         MPNowPlayingInfoCenter.default().nowPlayingInfo?[MPNowPlayingInfoPropertyElapsedPlaybackTime] = time.seconds
         playbackSlider.isEnabled = true
         playbackSlider.isEnabled = true
@@ -347,7 +341,7 @@ class NCPlayerToolBar: UIView {
             ncplayer.videoSeek(time: newTime)
             ncplayer.videoSeek(time: newTime)
         }
         }
         
         
-        updateToolBar(timeSeek: newTime)
+        updateToolBar()
         reStartTimerAutoHide()
         reStartTimerAutoHide()
     }
     }