PictureInPicture_Objc
@objc(THEOplayerPictureInPicture)
public protocol PictureInPicture_Objc
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
@objc(currentCorner) var currentCorner_Objc: PictureInPictureCorner { get }
-
Configures the picture-in-picture (PiP) view.
Declaration
Swift
@objc(configureWithMovable:defaultCorner:scale:visibility:margin:) func configure_Objc(movable: Bool, defaultCorner: PictureInPictureCorner, scale: Float, visibility: NSNumber?, 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
. Supports double-precision floating-point format.margin
The
THEOMargins
value indicating the distance between the PiP view and the screen. -
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: NSNumber?)
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
. Supports double-precision floating-point format. -
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. -
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
.Note
For additional methods, the delegate can conform to typeAVPictureInPictureControllerDelegateExtended
.Declaration
Swift
@available(iOS 14.0, tvOS 14.0, *) var nativePictureInPictureDelegate: AVPictureInPictureControllerDelegate? { get set }
-
Sets the picture-in-picture configuration dynamically.
Declaration
Swift
func configure(configuration: PiPConfiguration)
Parameters
configuration
The
PipConfiguration
object which describes the configuration of the picture-in-picture feature.