pub unsafe trait AVPictureInPictureSampleBufferPlaybackDelegate: NSObjectProtocol {
// Provided methods
unsafe fn pictureInPictureController_setPlaying(
&self,
picture_in_picture_controller: &AVPictureInPictureController,
playing: bool,
)
where Self: Sized + Message { ... }
unsafe fn pictureInPictureControllerTimeRangeForPlayback(
&self,
picture_in_picture_controller: &AVPictureInPictureController,
) -> CMTimeRange
where Self: Sized + Message { ... }
unsafe fn pictureInPictureControllerIsPlaybackPaused(
&self,
picture_in_picture_controller: &AVPictureInPictureController,
) -> bool
where Self: Sized + Message { ... }
unsafe fn pictureInPictureController_didTransitionToRenderSize(
&self,
picture_in_picture_controller: &AVPictureInPictureController,
new_render_size: CMVideoDimensions,
)
where Self: Sized + Message { ... }
unsafe fn pictureInPictureController_skipByInterval_completionHandler(
&self,
picture_in_picture_controller: &AVPictureInPictureController,
skip_interval: CMTime,
completion_handler: &DynBlock<dyn Fn()>,
)
where Self: Sized + Message { ... }
unsafe fn pictureInPictureControllerShouldProhibitBackgroundAudioPlayback(
&self,
picture_in_picture_controller: &AVPictureInPictureController,
) -> bool
where Self: Sized + Message { ... }
}AVPictureInPictureController_AVSampleBufferDisplayLayerSupport only.Expand description
A protocol for controlling playback from an AVSampleBufferDisplayLayer in Picture in Picture.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn pictureInPictureController_setPlaying(
&self,
picture_in_picture_controller: &AVPictureInPictureController,
playing: bool,
)
Available on crate feature AVPictureInPictureController only.
unsafe fn pictureInPictureController_setPlaying( &self, picture_in_picture_controller: &AVPictureInPictureController, playing: bool, )
AVPictureInPictureController only.Parameter pictureInPictureController: The Picture in Picture controller.
Parameter playing: Whether the content should play or pause.
Informs delegate that the user initiated a request to play or pause the content.
Sourceunsafe fn pictureInPictureControllerTimeRangeForPlayback(
&self,
picture_in_picture_controller: &AVPictureInPictureController,
) -> CMTimeRange
Available on crate features AVPictureInPictureController and objc2-core-media only.
unsafe fn pictureInPictureControllerTimeRangeForPlayback( &self, picture_in_picture_controller: &AVPictureInPictureController, ) -> CMTimeRange
AVPictureInPictureController and objc2-core-media only.Parameter pictureInPictureController: The Picture in Picture controller.
Allows delegate to inform Picture in Picture controller of the current playable time range. May be called multiple times during playback. Time ranges with finite duration should always contain the current time of the sample buffer display layer’s timebase.
Clients should return a time range with a duration of kCMTimeInfinity to indicate live content. When there is no content to play, they should return kCMTimeRangeInvalid. This method will be called whenever -[AVPictureInPictureController invalidatePlaybackState] is called and at other times as needed by the system.
Returns: A CMTimeRange indicating the content’s time range.
Sourceunsafe fn pictureInPictureControllerIsPlaybackPaused(
&self,
picture_in_picture_controller: &AVPictureInPictureController,
) -> bool
Available on crate feature AVPictureInPictureController only.
unsafe fn pictureInPictureControllerIsPlaybackPaused( &self, picture_in_picture_controller: &AVPictureInPictureController, ) -> bool
AVPictureInPictureController only.Parameter pictureInPictureController: The Picture in Picture controller.
Allows delegate to indicate whether the playback UI should reflect a playing or paused state, regardless of what the current playback rate might be. May be called multiple times during playback.
This method will be called whenever -[AVPictureInPictureController invalidatePlaybackState] is called and at other times as needed by the system.
Returns: A boolean value indicating whether or not the playback UI should indicate playback has been paused or is playing.
Sourceunsafe fn pictureInPictureController_didTransitionToRenderSize(
&self,
picture_in_picture_controller: &AVPictureInPictureController,
new_render_size: CMVideoDimensions,
)
Available on crate features AVPictureInPictureController and objc2-core-media only.
unsafe fn pictureInPictureController_didTransitionToRenderSize( &self, picture_in_picture_controller: &AVPictureInPictureController, new_render_size: CMVideoDimensions, )
AVPictureInPictureController and objc2-core-media only.Parameter pictureInPictureController: The Picture in Picture controller.
Parameter newRenderSize: The rendered size, in pixels, of Picture in Picture content.
This method is called when the system Picture in Picture window changes size. Delegate take the new render size and AVPictureInPictureController.isPictureInPictureActive into account when choosing media variants in order to avoid uncessary decoding overhead.
Sourceunsafe fn pictureInPictureController_skipByInterval_completionHandler(
&self,
picture_in_picture_controller: &AVPictureInPictureController,
skip_interval: CMTime,
completion_handler: &DynBlock<dyn Fn()>,
)
Available on crate features AVPictureInPictureController and block2 and objc2-core-media only.
unsafe fn pictureInPictureController_skipByInterval_completionHandler( &self, picture_in_picture_controller: &AVPictureInPictureController, skip_interval: CMTime, completion_handler: &DynBlock<dyn Fn()>, )
AVPictureInPictureController and block2 and objc2-core-media only.Parameter pictureInPictureController: The Picture in Picture controller.
Parameter skipInterval: The interval by which to skip playback.
Parameter completionHandler: A closure that must be invoked to indicate that the skip operation has completed.
Informs delegate that the user has requested skipping forward or backward by the time indicated by the interval.
Clients may choose to seek by a different interval for efficiency reasons (for example, seeking to a keyframe) or if the requested interval falls outside of the playable timeline. Clients must invoke the completion handler to indicate the seek operation has finished or failed. By the time the completion handler has been invoked, the timebase should reflect the current time and playback rate. Failure to invoke this completion handler is an application error and will result in playback UI permanently stuck in a “seeking” state.
Sourceunsafe fn pictureInPictureControllerShouldProhibitBackgroundAudioPlayback(
&self,
picture_in_picture_controller: &AVPictureInPictureController,
) -> bool
Available on crate feature AVPictureInPictureController only.
unsafe fn pictureInPictureControllerShouldProhibitBackgroundAudioPlayback( &self, picture_in_picture_controller: &AVPictureInPictureController, ) -> bool
AVPictureInPictureController only.Parameter pictureInPictureController: The Picture in Picture controller.
Allows the delegate to indicate whether background audio playback should always be prohibited.
If implemented, this optional method will be called once for each invocation of invalidatePlaybackState to allow the delegate to indicate whether or not audio playback should be prohibited when the picture in picture window is in the background.
Note that background in this context has a seperate meaning from application background used in UIKit. Here, background defines the state of the picture in picture window itself rather than the application.
Returns: A boolean value indicating whether or not background audio playback is always prohibited.