marinofaggiana 4 years ago
parent
commit
c628a64352

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

@@ -782,7 +782,7 @@ extension NCViewerImage: NCViewerVideoDelegate {
         pictureInPictureOcId = metadata.ocId
     }
     
-    func stopPictureInPicture(metadata: tableMetadata) {
+    func stopPictureInPicture(metadata: tableMetadata, playing: Bool) {
         pictureInPictureOcId = ""
     }
 }

+ 3 - 2
iOSClient/Viewer/NCViewerVideo/NCViewerVideo.swift

@@ -24,8 +24,8 @@
 import Foundation
 
 protocol NCViewerVideoDelegate {
-    func stopPictureInPicture(metadata: tableMetadata)
     func startPictureInPicture(metadata: tableMetadata)
+    func stopPictureInPicture(metadata: tableMetadata, playing: Bool)
 }
 
 @objc class NCViewerVideo: AVPlayerViewController {
@@ -111,6 +111,7 @@ extension NCViewerVideo: AVPlayerViewControllerDelegate {
     func playerViewControllerDidStopPictureInPicture(_ playerViewController: AVPlayerViewController) {
         NCManageDatabase.sharedInstance.addVideoTime(account: metadata.account, ocId: metadata.ocId, time: player?.currentTime())
         pictureInPicture = false
-        delegateViewerVideo?.stopPictureInPicture(metadata: metadata)
+        let playing = player?.timeControlStatus == .playing
+        delegateViewerVideo?.stopPictureInPicture(metadata: metadata, playing: playing)
     }
 }