Delegate protocol for Picture in Picture (PiP) functionality.
More...
#include "AliPlayerPictureInPictureDelegate.h"
Delegate protocol for Picture in Picture (PiP) functionality.
This protocol defines callback methods for various lifecycle stages and user interaction events when the player is in Picture in Picture mode.
All methods are optional (@optional).
◆ pictureInPictureController:didTransitionToRenderSize:
| - (void) pictureInPictureController: |
|
(nonnull AVPictureInPictureController *) | pictureInPictureController |
| didTransitionToRenderSize: |
|
(CMVideoDimensions) | newRenderSize |
|
optionalrequired |
Called when the Picture in Picture window's render size changes.
This method is invoked when the render size of the Picture in Picture window changes.
- Parameters
-
| pictureInPictureController | The Picture in Picture controller instance, non-null |
| newRenderSize | The new render size, of type CMVideoDimensions |
◆ pictureInPictureController:failedToStartPictureInPictureWithError:
| - (void) pictureInPictureController: |
|
(AVPictureInPictureController *_Nullable) | pictureInPictureController |
| failedToStartPictureInPictureWithError: |
|
(NSError *_Nullable) | error |
|
optionalrequired |
Called when Picture in Picture fails to start.
This method is invoked when the system attempts to start Picture in Picture but fails.
- Parameters
-
| pictureInPictureController | The Picture in Picture controller instance, which may be nil |
| error | The error information for the failure, which may be nil |
◆ pictureInPictureController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:
| - (void) pictureInPictureController: |
|
(AVPictureInPictureController *_Nullable) | pictureInPictureController |
| restoreUserInterfaceForPictureInPictureStopWithCompletionHandler: |
|
(void(^)(BOOL restored)) | completionHandler |
|
optionalrequired |
Called to restore the user interface before Picture in Picture stops.
This method is invoked when Picture in Picture is about to stop, notifying the delegate to restore the main player's user interface.
The completion handler must be called with YES to allow the system to complete the interface restoration.
- Parameters
-
| pictureInPictureController | The Picture in Picture controller instance, which may be nil |
| completionHandler | The completion handler that must be called with YES to allow the system to complete the restoration |
◆ pictureInPictureController:setPlaying:
| - (void) pictureInPictureController: |
|
(nonnull AVPictureInPictureController *) | pictureInPictureController |
| setPlaying: |
|
(BOOL) | playing |
|
optionalrequired |
Called when the user taps the play/pause button in the Picture in Picture window.
This method is invoked when the user taps the play/pause button in the Picture in Picture window.
- Parameters
-
| pictureInPictureController | The Picture in Picture controller instance, non-null |
| playing | Indicates whether the player should be in playing (YES) or paused (NO) state |
◆ pictureInPictureController:skipByInterval:completionHandler:
| - (void) pictureInPictureController: |
|
(nonnull AVPictureInPictureController *) | pictureInPictureController |
| skipByInterval: |
|
(CMTime) | skipInterval |
| completionHandler: |
|
(nonnull void(^)(void)) | completionHandler |
|
optionalrequired |
Called when the user requests skipping forward or backward in the Picture in Picture window.
This method is invoked when the user taps the skip forward or backward button in the Picture in Picture window.
The completion handler must be called to notify the system that the skip operation has completed.
- Parameters
-
| pictureInPictureController | The Picture in Picture controller instance, non-null |
| skipInterval | The time interval to skip; positive for forward, negative for backward |
| completionHandler | The completion handler that must be called to notify the system that the skip operation has completed |
◆ pictureInPictureControllerDidStartPictureInPicture:
| - (void) pictureInPictureControllerDidStartPictureInPicture: |
|
(AVPictureInPictureController *_Nullable) | pictureInPictureController |
|
|
optionalrequired |
Called when Picture in Picture has successfully started.
This method is invoked after Picture in Picture mode has been successfully entered.
- Parameters
-
| pictureInPictureController | The Picture in Picture controller instance, which may be nil |
◆ pictureInPictureControllerDidStopPictureInPicture:
| - (void) pictureInPictureControllerDidStopPictureInPicture: |
|
(AVPictureInPictureController *_Nullable) | pictureInPictureController |
|
|
optionalrequired |
Called when Picture in Picture has stopped.
This method is invoked after Picture in Picture mode has been fully exited.
- Parameters
-
| pictureInPictureController | The Picture in Picture controller instance, which may be nil |
◆ pictureInPictureControllerIsPictureInPictureEnable:isEnable:
| - (void) pictureInPictureControllerIsPictureInPictureEnable: |
|
(nullable AVPictureInPictureController *) | pictureInPictureController |
| isEnable: |
|
(BOOL) | isEnable |
|
optionalrequired |
Called when the Picture in Picture feature's enable state changes.
This method is invoked when the enable state of the Picture in Picture feature changes.
- Parameters
-
| pictureInPictureController | The Picture in Picture controller instance, which may be nil |
| isEnable | YES if Picture in Picture is enabled, NO if disabled |
◆ pictureInPictureControllerIsPlaybackPaused:
| - (BOOL) pictureInPictureControllerIsPlaybackPaused: |
|
(nonnull AVPictureInPictureController *) | pictureInPictureController |
|
|
optionalrequired |
Called to query the current playback state for updating the Picture in Picture UI.
This method allows the delegate to return the actual playback state of the player so that the Picture in Picture controller can correctly display the play/pause button state.
- Parameters
-
| pictureInPictureController | The Picture in Picture controller instance, non-null |
- Returns
- YES if currently paused, NO if currently playing
◆ pictureInPictureControllerTimeRangeForPlayback:layerTime:
| - (CMTimeRange) pictureInPictureControllerTimeRangeForPlayback: |
|
(nonnull AVPictureInPictureController *) | pictureInPictureController |
| layerTime: |
|
(CMTime) | layerTime |
|
optionalrequired |
Called to provide the current playable time range.
This method allows the delegate to inform the Picture in Picture controller of the current playable time range of the media.
- Parameters
-
| pictureInPictureController | The Picture in Picture controller instance, non-null |
| layerTime | The current layer time |
- Returns
- The current playable time range of the media, of type CMTimeRange
◆ pictureInPictureControllerWillStartPictureInPicture:
| - (void) pictureInPictureControllerWillStartPictureInPicture: |
|
(AVPictureInPictureController *_Nullable) | pictureInPictureController |
|
|
optional |
Called when Picture in Picture is about to start.
This method is invoked before the system attempts to start Picture in Picture mode.
- Parameters
-
| pictureInPictureController | The Picture in Picture controller instance, which may be nil |
◆ pictureInPictureControllerWillStopPictureInPicture:
| - (void) pictureInPictureControllerWillStopPictureInPicture: |
|
(AVPictureInPictureController *_Nullable) | pictureInPictureController |
|
|
optionalrequired |
Called when Picture in Picture is about to stop.
This method is invoked before the system prepares to exit Picture in Picture mode.
- Parameters
-
| pictureInPictureController | The Picture in Picture controller instance, which may be nil |
The documentation for this protocol was generated from the following file: