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

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

@@ -123,9 +123,9 @@ class NCViewerImage: UIViewController, UIGestureRecognizerDelegate {
         navigationController?.popViewController(animated: true)
         navigationController?.popViewController(animated: true)
     }
     }
     
     
-    override func viewDidDisappear(_ animated: Bool) {
-        super.viewDidDisappear(animated)
-        
+    override func viewWillDisappear(_ animated: Bool) {
+        super.viewWillDisappear(animated)
+   
         videoStop()
         videoStop()
     }
     }
     
     
@@ -603,6 +603,7 @@ class NCViewerImage: UIViewController, UIGestureRecognizerDelegate {
         if rateObserverToken != nil {
         if rateObserverToken != nil {
             player?.removeObserver(self, forKeyPath: "rate")
             player?.removeObserver(self, forKeyPath: "rate")
             NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: nil)
             NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: nil)
+            NCKTVHTTPCache.shared.stopProxy()
             self.rateObserverToken = nil
             self.rateObserverToken = nil
         }
         }
         
         
@@ -611,7 +612,7 @@ class NCViewerImage: UIViewController, UIGestureRecognizerDelegate {
             self.timeObserverToken = nil
             self.timeObserverToken = nil
         }
         }
         
         
-        NCKTVHTTPCache.shared.stopProxy()
+        
     }
     }
 }
 }