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 bePresentationMode.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
topictureInPicture
.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.
Remark
For more informations check https://developer.apple.com/documentation/avkit/avpictureinpicturecontrollerdelegate. Only supported whenPiPConfiguration.nativePictureInPicture
is set totrue
.Declaration
Swift
@available(iOS 14.0, tvOS 14.0, *) var nativePictureInPictureDelegate: AVPictureInPictureControllerDelegate? { get set }
-
configure(movable:
Extension methoddefaultCorner: scale: ) 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.
-
configure(movable:
Extension methoddefaultCorner: scale: visibility: ) 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
topictureInPicture
. -
configure(movable:
Extension methoddefaultCorner: scale: margin: ) 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.