Browse Source

coding Video PIP

marinofaggiana 4 years ago
parent
commit
ac1468c143

+ 1 - 1
iOSClient/Images.xcassets/pip.imageset/Contents.json

@@ -1,7 +1,7 @@
 {
   "images" : [
     {
-      "filename" : "pip.pdf",
+      "filename" : "pip.png",
       "idiom" : "universal"
     }
   ],

BIN
iOSClient/Images.xcassets/pip.imageset/pip.pdf


BIN
iOSClient/Images.xcassets/pip.imageset/pip.png


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

@@ -696,7 +696,9 @@ extension NCViewerImage: NCViewerImageZoomDelegate {
 
         if (currentMetadata.typeFile == k_metadataTypeFile_video || currentMetadata.typeFile == k_metadataTypeFile_audio) {
             if pictureInPictureOcId != metadata.ocId {
-                videoPlay(metadata: metadata)
+                if UIApplication.shared.applicationState != .background {
+                    videoPlay(metadata: metadata)
+                }
                 toolBar.isHidden = false
             }
         }

+ 4 - 0
iOSClient/Viewer/NCViewerVideo/NCViewerVideo.swift

@@ -109,6 +109,10 @@ protocol NCViewerVideoDelegate {
 
 extension NCViewerVideo: AVPlayerViewControllerDelegate {
     
+    func playerViewControllerShouldAutomaticallyDismissAtPictureInPictureStart(_ playerViewController: AVPlayerViewController) -> Bool {
+        false
+    }
+    
     func playerViewControllerDidStartPictureInPicture(_ playerViewController: AVPlayerViewController) {
         pictureInPicture = true
         delegateViewerVideo?.startPictureInPicture(metadata: metadata)