From 0da1e6d9f4d1fe9dec9199f917f45ab8fc6f6fe3 Mon Sep 17 00:00:00 2001 From: Michele Pozzi <123.mpozzi@gmail.com> Date: Fri, 13 Oct 2023 09:19:20 +0200 Subject: [PATCH] feat(shouldEnterOnBackground): fix tvOS and iOS version build --- ios/RCTConvert+BitmovinPlayer.swift | 9 +++++---- src/components/PlayerView/pictureInPictureConfig.ts | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ios/RCTConvert+BitmovinPlayer.swift b/ios/RCTConvert+BitmovinPlayer.swift index 70810154..5e763c79 100644 --- a/ios/RCTConvert+BitmovinPlayer.swift +++ b/ios/RCTConvert+BitmovinPlayer.swift @@ -1048,11 +1048,12 @@ extension RCTConvert { if let isEnabled = json["isEnabled"] as? Bool { pictureInPictureConfig.isEnabled = isEnabled } - if let shouldEnterOnBackground = json["shouldEnterOnBackground"] as? Bool { - if #available(iOS 14.2, *) { - pictureInPictureConfig.shouldEnterOnBackground = shouldEnterOnBackground - } +#if os(iOS) + if #available(iOS 14.2, *), + let shouldEnterOnBackground = json["shouldEnterOnBackground"] as? Bool { + pictureInPictureConfig.shouldEnterOnBackground = shouldEnterOnBackground } +#endif return pictureInPictureConfig } } diff --git a/src/components/PlayerView/pictureInPictureConfig.ts b/src/components/PlayerView/pictureInPictureConfig.ts index 7a486a6a..2b7fdd6c 100644 --- a/src/components/PlayerView/pictureInPictureConfig.ts +++ b/src/components/PlayerView/pictureInPictureConfig.ts @@ -16,7 +16,7 @@ export interface PictureInPictureConfig { * * Default is `false`. * - * @platform iOS + * @platform iOS 14.2 and above */ shouldEnterOnBackground?: boolean; }