Эх сурвалжийг харах

Fix

Signed-off-by: marinofaggiana <marino@marinofaggiana.com>
marinofaggiana 3 жил өмнө
parent
commit
6702b4546c

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

@@ -119,7 +119,11 @@ class NCPlayer: NSObject {
                 break
             case .failed:
                 DispatchQueue.main.async {
-                    NCContentPresenter.shared.messageNotification("_error_", description: "_error_something_wrong_", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.info, errorCode: NCGlobal.shared.errorGeneric, forced: false)
+                    var description = NSLocalizedString("_error_something_wrong_", comment: "")
+                    if let errorDescription = error?.localizedDescription, let failureReason = error?.localizedFailureReason {
+                        description = NSLocalizedString("_error_something_wrong_", comment: "") + "\n" + errorDescription + "\n" + failureReason
+                    }
+                    NCContentPresenter.shared.messageNotification("_error_", description: description, delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.info, errorCode: NCGlobal.shared.errorGeneric, forced: false)
                 }
                 break
             case .cancelled:

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

@@ -52,7 +52,7 @@ class NCPlayerToolBar: UIView {
     private var durationTime: CMTime = .zero
     private var timeObserver: Any?
     private var timerAutoHide: Timer?
-    private var metadata: tableMetadata!
+    private var metadata: tableMetadata?
 
     // MARK: - View Life Cycle
 
@@ -178,6 +178,7 @@ class NCPlayerToolBar: UIView {
     }
     
     public func show(enableTimerAutoHide: Bool) {
+        guard let metadata = self.metadata else { return }
         
         if metadata.classFile != NCCommunicationCommon.typeClassFile.video.rawValue && metadata.classFile != NCCommunicationCommon.typeClassFile.audio.rawValue { return }
         if metadata.livePhoto { return }
@@ -205,7 +206,8 @@ class NCPlayerToolBar: UIView {
     }
     
     public func updateToolBar(timeSeek: CMTime? = nil) {
-
+        guard let metadata = self.metadata else { return }
+        
         var namedPlay = "play.fill"
         var currentTime = appDelegate.player?.currentTime() ?? .zero
         currentTime = currentTime.convertScale(1000, method: .default)
@@ -339,7 +341,8 @@ class NCPlayerToolBar: UIView {
     }
     
     @IBAction func setPip(_ sender: Any) {
-        
+        guard let metadata = self.metadata else { return }
+
         ncplayer?.pictureInPictureController?.startPictureInPicture()
         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterHidePlayerToolBar, userInfo: ["ocId":metadata.ocId])
     }