marinofaggiana 3 rokov pred
rodič
commit
6ea3fbd47d

+ 0 - 7
iOSClient/Viewer/NCViewerImage/NCViewerImage.swift

@@ -564,13 +564,6 @@ extension NCViewerImage: NCViewerImageZoomDelegate {
         currentMetadata = metadata
         currentViewerImageZoom = viewerImageZoom
         
-        // PLAY VIDEO/AUDIO
-        if (currentMetadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || currentMetadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue) {
-            DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
-                NCViewerVideo.shared.initVideoPlayer(imageView: viewerImageZoom.imageView, viewerVideoToolBar: viewerImageZoom.videoToolBar, metadata: metadata)
-            }
-        }
-            
         if !NCOperationQueue.shared.downloadExists(metadata: metadata) {
             self.progressView.progress = 0
         }

+ 6 - 0
iOSClient/Viewer/NCViewerImage/NCViewerImageZoom.swift

@@ -77,10 +77,16 @@ class NCViewerImageZoom: UIViewController {
             if !metadata.livePhoto {
                 videoToolBar.isHidden = false
             }
+            DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
+                NCViewerVideo.shared.initVideoPlayer(imageView: self.imageView, viewerVideoToolBar: self.videoToolBar, metadata: self.metadata)
+            }
         } else if metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
             if image == nil {
                 image = UIImage.init(named: "noPreviewAudio")!.image(color: .gray, size: view.frame.width)
             }
+            DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
+                NCViewerVideo.shared.initVideoPlayer(imageView: self.imageView, viewerVideoToolBar: self.videoToolBar, metadata: self.metadata)
+            }
         } else {
             if image == nil {
                 image = UIImage.init(named: "noPreview")!.image(color: .gray, size: view.frame.width)