Browse Source

Merge pull request #1874 from nextcloud/alignmentVersionMedia

alignment
Marino Faggiana 3 years ago
parent
commit
04242038f2

+ 1 - 1
iOSClient/Menu/NCViewer+Menu.swift

@@ -142,7 +142,7 @@ extension NCViewer {
             
             actions.append(
                 NCMenuAction(
-                    title: NSLocalizedString("_video_conversion_", comment: ""),
+                    title: NSLocalizedString("_video_processing_", comment: ""),
                     icon: NCUtility.shared.loadImage(named: "film"),
                     action: { menuAction in
                         if let ncplayer = (viewController as? NCViewerMediaPage)?.currentViewController.ncplayer {

+ 10 - 4
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayer.swift

@@ -32,10 +32,10 @@ class NCPlayer: NSObject {
     internal let appDelegate = UIApplication.shared.delegate as! AppDelegate
     internal var url: URL
     internal var playerToolBar: NCPlayerToolBar?
-    
+    internal var viewController: UIViewController
+
     private var imageVideoContainer: imageVideoContainerView
     private var detailView: NCViewerMediaDetailView?
-    private var viewController: UIViewController
     private var observerAVPlayerItemDidPlayToEndTime: Any?
     private var observerAVPlayertTime: Any?
 
@@ -65,11 +65,17 @@ class NCPlayer: NSObject {
             print(error)
         }
         
-        // Exists the file video encoded
+        #if MFFFLIB
         if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: NCGlobal.shared.fileNameVideoEncoded) {
             self.url = URL(fileURLWithPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: NCGlobal.shared.fileNameVideoEncoded))
         }
-
+        if MFFF.shared.existsMFFFSession(url: URL(fileURLWithPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView))) {
+            return
+        } else {
+            MFFF.shared.dismissMessage()
+        }
+        #endif
+              
         openAVPlayer() { status, error in
             
             switch status {

+ 3 - 3
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift

@@ -262,9 +262,9 @@ class NCPlayerToolBar: UIView {
 
     public func show(enableTimerAutoHide: Bool = false) {
 
-        guard let metadata = self.metadata, ncplayer != nil, !metadata.livePhoto, (metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue) else
-        { return }
-        
+        guard let metadata = self.metadata, ncplayer != nil, !metadata.livePhoto else { return }
+        if metadata.classFile != NCCommunicationCommon.typeClassFile.video.rawValue && metadata.classFile != NCCommunicationCommon.typeClassFile.audio.rawValue { return }
+
         #if MFFFLIB
         if MFFF.shared.existsMFFFSession(url: URL(fileURLWithPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView))) {
             self.hide()

+ 2 - 5
iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift

@@ -164,12 +164,9 @@ class NCViewerMedia: UIViewController {
             }
             
             #if MFFFLIB
-            MFFF.shared.delegate = self.ncplayer
-//            if !MFFF.shared.existsMFFFSession(url: URL(fileURLWithPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView))) {
-//                self.playerToolBar.hideMessage()
-//            }
+            MFFF.shared.setDelegate = self.ncplayer
             #endif
-
+            
         } else if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue {
 
             viewerMediaPage?.clearCommandCenter()

+ 5 - 1
iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift

@@ -117,7 +117,11 @@ class NCViewerMediaPage: UIViewController {
 
         metadatas.removeAll()
         ncplayerLivePhoto = nil
-
+        
+        #if MFFFLIB
+        MFFF.shared.dismissMessage()
+        #endif
+        
         // Remove Observer
         NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterDeleteFile), object: nil)
         NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterRenameFile), object: nil)