PictureInPicture

public protocol PictureInPicture

Helps configure the settings when PresentationMode.pictureInPicture is active.

  • The current PictureInPictureCorner the PiP view is displayed in.

    Precondition

    The presentation mode of the player must be PresentationMode.pictureInPicture.

    Declaration

    Swift

    var currentCorner: PictureInPictureCorner? { get }
  • Configures the picture-in-picture (PiP) view.

    Declaration

    Swift

    func configure(movable: Bool?, defaultCorner: PictureInPictureCorner?, scale: Float?, visibility: Double?, margin: THEOMargins?)

    Parameters

    movable

    Indicates wheter or not the PiP view is movable.

    defaultCorner

    Indicates the default corner at which the PiP view will appear when entering PiP mode.

    scale

    Indicates the scale of the PiP view, defaults to 0.33.

    visibility

    The maximum percentage of the original player position that should be visible to enable picture-in-picture automatically, from 0 to 1. If not configured, picture-in-picture can only be turned on by setting presentationMode to pictureInPicture.

    margin

    The THEOMargins value indicating the distance between the PiP view and the screen.

  • The protocol that defines the methods to respond to Picture in Picture events.

    Declaration

    Swift

    @available(iOS 14.0, tvOS 14.0, *)
    var nativePictureInPictureDelegate: AVPictureInPictureControllerDelegate? { get set }
  • Configures the picture-in-picture (PiP) view

    Declaration

    Swift

    func configure(movable: Bool?, defaultCorner: PictureInPictureCorner?, scale: Float?)

    Parameters

    movable

    Indicates whether the PiP view is movable.

    defaultCorner

    Indicates the default corner at which the PiP view will appear when entering PiP mode.

    scale

    Indicates the scale of the PiP view, defaults to 0.33.

  • Configures the picture-in-picture (PiP) view.

    Declaration

    Swift

    func configure(movable: Bool?, defaultCorner: PictureInPictureCorner?, scale: Float?, visibility: Double?)

    Parameters

    movable

    Indicates whether the PiP view is movable.

    defaultCorner

    Indicates the default corner at which the PiP view will appear when entering PiP mode.

    scale

    Indicates the scale of the PiP view, defaults to 0.33.

    visibility

    The maximum percentage of the original player position that should be visible to enable picture-in-picture automatically, from 0 to 1. If not configured, picture-in-picture can only be turned on by setting presentationMode to pictureInPicture.

  • Configures the picture-in-picture (PiP) view.

    Declaration

    Swift

    func configure(movable: Bool?, defaultCorner: PictureInPictureCorner?, scale: Float?, margin: THEOMargins?)

    Parameters

    movable

    Indicates whether the PiP view is movable.

    defaultCorner

    Indicates the default corner at which the PiP view will appear when entering PiP mode.

    scale

    Indicates the scale of the PiP view, defaults to 0.33.

    margin

    The THEOMargins value indicating the distance between the PiP view and the screen.