PictureInPictureConfig

@objcMembers
@objc(BMPPictureInPictureConfig)
public class PictureInPictureConfig : NSObject, @unchecked Sendable

Provides options to configure Picture in Picture playback.

  • Type definition for the handler that will be called before Picture In Picture stops.

    Declaration

    Swift

    public typealias RestoreUserInterfaceHandler = (
        _ completionHandler: @escaping (_ restored: Bool) -> Void
    ) -> Void

    Parameters

    completionHandler

    The completion handler that needs to be called when the user interface is restored.

  • Whether Picture in Picture feature is enabled or not. Default is false.

    Declaration

    Swift

    public var isEnabled: Bool
  • Defines whether the skip-backward and skip-forward buttons should be visible when Picture in Picture is active.

    Default is true.

    Declaration

    Swift

    @available(tvOS, unavailable)
    public var showSkipControls: Bool { get set }
  • Defines whether Picture in Picture should start automatically when the app transitions to background.

    Does not have any affect when Picture in Picture is disabled.

    Default is false.

    Declaration

    Swift

    @available(iOS 14.2, *)
    @available(tvOS, unavailable)
    public var shouldEnterOnBackground: Bool { get set }
  • Closure which will be called just before Picture in Picture stops.

    Can be used to restore the user interface. Call the completion handler once done. he system will wait up to one second for the completion handler before Picture in Picture is stopped. If the completion handler is not called in time, Picture in Picture will be stopped regardless.

    Declaration

    Swift

    public var restoreUserInterfaceHandler: RestoreUserInterfaceHandler?