Browse Source

coding

Signed-off-by: marinofaggiana <marino@marinofaggiana.com>
marinofaggiana 3 years ago
parent
commit
d669a3c682

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

@@ -110,7 +110,7 @@ class NCPlayer: NSObject {
                         self.videoLayer!.frame = imageVideoContainer.bounds
                         self.videoLayer!.videoGravity = .resizeAspect
                         
-                        if metadata.classFile != NCCommunicationCommon.typeClassFile.audio.rawValue {
+                        if metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue {
                         
                             imageVideoContainer.layer.addSublayer(self.videoLayer!)
                             imageVideoContainer.playerLayer = self.videoLayer
@@ -120,7 +120,8 @@ class NCPlayer: NSObject {
                                     imageVideoContainer.image = imageVideoContainer.image?.image(alpha: 0)
                                 }
                             }
-                            // PiP
+                            
+                            // PIP
                             if let playerLayer = self.videoLayer, CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
                                 self.pictureInPictureController = AVPictureInPictureController(playerLayer: playerLayer)
                                 self.pictureInPictureController?.delegate = self

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

@@ -166,7 +166,7 @@ class NCPlayerToolBar: UIView {
         muteButton.isEnabled = true
         
         // PIP
-        if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
+        if metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue && CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
             pipButton.setImage(NCUtility.shared.loadImage(named: "pip.enter", color: .white), for: .normal)
             pipButton.isEnabled = true
             if let ncplayer = self.ncplayer, let playerLayer = ncplayer.videoLayer, ncplayer.pictureInPictureController == nil {