public interface AVPictureInPictureSampleBufferPlaybackDelegate
A protocol for controlling playback from an AVSampleBufferDisplayLayer in Picture in Picture.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
AVPictureInPictureSampleBufferPlaybackDelegate.Block_pictureInPictureControllerSkipByIntervalCompletionHandler |
| Modifier and Type | Method and Description |
|---|---|
void |
pictureInPictureControllerDidTransitionToRenderSize(AVPictureInPictureController pictureInPictureController,
CMVideoDimensions newRenderSize)
pictureInPictureController:didTransitionToRenderSize:
|
boolean |
pictureInPictureControllerIsPlaybackPaused(AVPictureInPictureController pictureInPictureController)
pictureInPictureControllerIsPlaybackPaused:
|
void |
pictureInPictureControllerSetPlaying(AVPictureInPictureController pictureInPictureController,
boolean playing)
pictureInPictureController:setPlaying:
|
default boolean |
pictureInPictureControllerShouldProhibitBackgroundAudioPlayback(AVPictureInPictureController pictureInPictureController)
pictureInPictureControllerShouldProhibitBackgroundAudioPlayback:
|
void |
pictureInPictureControllerSkipByIntervalCompletionHandler(AVPictureInPictureController pictureInPictureController,
CMTime skipInterval,
AVPictureInPictureSampleBufferPlaybackDelegate.Block_pictureInPictureControllerSkipByIntervalCompletionHandler completionHandler)
pictureInPictureController:skipByInterval:completionHandler:
|
CMTimeRange |
pictureInPictureControllerTimeRangeForPlayback(AVPictureInPictureController pictureInPictureController)
pictureInPictureControllerTimeRangeForPlayback:
|
void pictureInPictureControllerDidTransitionToRenderSize(AVPictureInPictureController pictureInPictureController, CMVideoDimensions newRenderSize)
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.
pictureInPictureController - The Picture in Picture controller.newRenderSize - The rendered size, in pixels, of Picture in Picture content.void pictureInPictureControllerSetPlaying(AVPictureInPictureController pictureInPictureController, boolean playing)
Informs delegate that the user initiated a request to play or pause the content.
pictureInPictureController - The Picture in Picture controller.playing - Whether the content should play or pause.void pictureInPictureControllerSkipByIntervalCompletionHandler(AVPictureInPictureController pictureInPictureController, CMTime skipInterval, AVPictureInPictureSampleBufferPlaybackDelegate.Block_pictureInPictureControllerSkipByIntervalCompletionHandler completionHandler)
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.
pictureInPictureController - The Picture in Picture controller.skipInterval - The interval by which to skip playback.completionHandler - A closure that must be invoked to indicate that the skip operation has completed.boolean pictureInPictureControllerIsPlaybackPaused(AVPictureInPictureController pictureInPictureController)
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.
pictureInPictureController - The Picture in Picture controller.default boolean pictureInPictureControllerShouldProhibitBackgroundAudioPlayback(AVPictureInPictureController pictureInPictureController)
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.
pictureInPictureController - The Picture in Picture controller.CMTimeRange pictureInPictureControllerTimeRangeForPlayback(AVPictureInPictureController pictureInPictureController)
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.
pictureInPictureController - The Picture in Picture controller.