marinofaggiana 3 년 전
부모
커밋
1d6581ecc5
1개의 변경된 파일1개의 추가작업 그리고 9개의 파일을 삭제
  1. 1 9
      iOSClient/Viewer/NCViewerImage/NCViewerImage.swift

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

@@ -366,14 +366,6 @@ class NCViewerImage: UIViewController {
                 
                 currentViewerImageZoom!.imageView.layer.addSublayer(videoLayer!)
                 
-                // At end go back to start
-                NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: player?.currentItem, queue: .main) { (notification) in
-                    if let item = notification.object as? AVPlayerItem, let currentItem = self.player?.currentItem, item == currentItem {
-                        self.player?.seek(to: CMTime.zero)
-                        NCManageDatabase.shared.addVideoTime(metadata: self.currentMetadata, time: CMTime.zero)
-                    }
-                }
-                            
                 rateObserver = player?.addObserver(self, forKeyPath: "rate", options: [], context: nil)
                 
                 if pictureInPictureOcId != metadata.ocId {
@@ -441,7 +433,7 @@ class NCViewerImage: UIViewController {
                     }
                 }
                 
-            } else {
+            } else if !self.currentMetadata.livePhoto {
                 
                 NCManageDatabase.shared.addVideoTime(metadata: self.currentMetadata, time: player?.currentTime())
                 print("Pause")