marinofaggiana 4 years ago
parent
commit
ad0aacf356
1 changed files with 9 additions and 5 deletions
  1. 9 5
      iOSClient/Viewer/NCViewerImage/NCViewerImage.swift

+ 9 - 5
iOSClient/Viewer/NCViewerImage/NCViewerImage.swift

@@ -57,7 +57,7 @@ class NCViewerImage: UIViewController {
     
     private var player: AVPlayer?
     private var videoLayer: AVPlayerLayer?
-    private var timeObserver: Any?
+    //private var timeObserver: Any?
     private var rateObserver: Any?
     var pictureInPictureOcId: String = ""
     var textColor: UIColor = NCBrandColor.shared.textView
@@ -389,10 +389,10 @@ class NCViewerImage: UIViewController {
         player?.seek(to: CMTime.zero)
         progressView.progress = 0
         
-        if let timeObserver = timeObserver {
-            player?.removeTimeObserver(timeObserver)
-            self.timeObserver = nil
-        }
+//        if let timeObserver = timeObserver {
+//            player?.removeTimeObserver(timeObserver)
+//            self.timeObserver = nil
+//        }
         
         if rateObserver != nil {
             player?.removeObserver(self, forKeyPath: "rate")
@@ -404,6 +404,7 @@ class NCViewerImage: UIViewController {
         videoLayer?.removeFromSuperlayer()
     }
     
+    /*
     func updateVideoProgressBar(time: CMTime) {
                 
         if let duration = player?.currentItem?.asset.duration {
@@ -416,6 +417,7 @@ class NCViewerImage: UIViewController {
         }
         progressView.progress = 0
     }
+    */
     
     override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
         
@@ -430,6 +432,7 @@ class NCViewerImage: UIViewController {
                     player?.isMuted = CCUtility.getAudioMute()
                 }
                 
+                /*
                 if rateObserver != nil && !currentMetadata.livePhoto {
                     DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
                         if let duration = self.player?.currentItem?.asset.duration {
@@ -447,6 +450,7 @@ class NCViewerImage: UIViewController {
                         }
                     }
                 }
+                */
                 
             } else {