Browse Source

coding

Signed-off-by: marinofaggiana <marino@marinofaggiana.com>
marinofaggiana 3 years ago
parent
commit
a4dfcba8c2
1 changed files with 28 additions and 30 deletions
  1. 28 30
      iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift

+ 28 - 30
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift

@@ -343,6 +343,34 @@ class NCPlayerToolBar: UIView {
     
     // MARK: -
 
+    public func show(enableTimerAutoHide: Bool) {
+        guard let metadata = self.metadata else { return }
+        
+        if metadata.classFile != NCCommunicationCommon.typeClassFile.video.rawValue && metadata.classFile != NCCommunicationCommon.typeClassFile.audio.rawValue { return }
+        if metadata.livePhoto { return }
+        
+        timerAutoHide?.invalidate()
+        if enableTimerAutoHide {
+            startTimerAutoHide()
+        }
+        
+        if !self.isHidden { return }
+
+        updateToolBar()
+            
+        UIView.animate(withDuration: 0.3, animations: {
+            self.alpha = 1
+            self.playerTopToolBarView.alpha = 1
+        }, completion: { (value: Bool) in
+            self.isHidden = false
+            self.playerTopToolBarView.isHidden = false
+        })
+    }
+    
+    func isShow() -> Bool {
+        return !self.isHidden
+    }
+    
     public func hide() {
               
         UIView.animate(withDuration: 0.3, animations: {
@@ -374,36 +402,6 @@ class NCPlayerToolBar: UIView {
         }
     }
     
-    public func show(enableTimerAutoHide: Bool) {
-        guard let metadata = self.metadata else { return }
-        
-        if metadata.classFile != NCCommunicationCommon.typeClassFile.video.rawValue && metadata.classFile != NCCommunicationCommon.typeClassFile.audio.rawValue { return }
-        if metadata.livePhoto { return }
-        
-        timerAutoHide?.invalidate()
-        if enableTimerAutoHide {
-            startTimerAutoHide()
-        }
-        
-        if !self.isHidden { return }
-
-        updateToolBar()
-            
-        UIView.animate(withDuration: 0.3, animations: {
-            self.alpha = 1
-            self.playerTopToolBarView.alpha = 1
-        }, completion: { (value: Bool) in
-            self.isHidden = false
-            self.playerTopToolBarView.isHidden = false
-        })        
-    }
-    
-    func isShow() -> Bool {
-        return !self.isHidden
-    }
-    
-    
-    
     func skip(seconds: Float64) {
         guard let ncplayer = ncplayer else { return }
         guard let player = appDelegate.player else { return }