From 340278b53781639880612f94efcc1dd0b8edf22a Mon Sep 17 00:00:00 2001 From: Peeter Kask Date: Fri, 4 Oct 2024 12:32:05 +0300 Subject: [PATCH] PiP should be started with slight delays. Otherwise PiP listener events are not being fired when app is initially started. Some kind of Av player internal issue probably. --- ios/Video/Features/RCTPictureInPicture.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Video/Features/RCTPictureInPicture.swift b/ios/Video/Features/RCTPictureInPicture.swift index ab24cd87be..b049704fae 100644 --- a/ios/Video/Features/RCTPictureInPicture.swift +++ b/ios/Video/Features/RCTPictureInPicture.swift @@ -76,7 +76,7 @@ import React guard let _pipController else { return } if _isActive && !_pipController.isPictureInPictureActive { - DispatchQueue.main.async { + DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) { _pipController.startPictureInPicture() } } else if !_isActive && _pipController.isPictureInPictureActive {