AgoraPipOptions
Configuration options for Agora picture-in-picture mode.
export class AgoraPipOptions {
autoEnterEnabled?: boolean;
aspectRatioX?: number;
aspectRatioY?: number;
sourceRectHintLeft?: number;
sourceRectHintTop?: number;
sourceRectHintRight?: number;
sourceRectHintBottom?: number;
seamlessResizeEnabled?: boolean;
useExternalStateMonitor?: boolean;
externalStateMonitorInterval?: number;
videoStreams?: RtcRendererViewProps[];
contentViewLayout?: AgoraPipContentViewLayout;
sourceContentView?: number;
contentView?: number;
preferredContentWidth?: number;
preferredContentHeight?: number;
controlStyle?: number;
}
- Since
- Available since v4.6.2.
This class provides platform-specific options to configure picture-in-picture behavior on Android and iOS.
Properties
- autoEnterEnabled
- Whether to automatically enter picture-in-picture mode.
- aspectRatioX
- Horizontal aspect ratio of the picture-in-picture window. (Android only)
- aspectRatioY
- Vertical aspect ratio of the picture-in-picture window. (Android only)
- sourceRectHintLeft
- Left coordinate of the source rectangle hint. Used to specify the initial position of the picture-in-picture window. (Android only)
- sourceRectHintTop
- Top coordinate of the source rectangle hint. Used to specify the initial position of the picture-in-picture window. (Android only)
- sourceRectHintRight
- Right coordinate of the source rectangle hint. Used to specify the initial position of the picture-in-picture window. (Android only)
- sourceRectHintBottom
- Bottom coordinate of the source rectangle hint. Used to specify the initial position of the picture-in-picture window. (Android only)
- seamlessResizeEnabled
- Whether to enable seamless resizing of the picture-in-picture window.
When enabled, the window resizes smoothly.
Default is
false. (Android only) - useExternalStateMonitor
- Whether to use an external state monitor.
When enabled, a dedicated thread is created to monitor the state of the picture-in-picture window. Use
externalStateMonitorIntervalto configure the monitoring frequency. Default is true. (Android only) - externalStateMonitorInterval
- Interval for external state monitoring, in milliseconds.
Takes effect only when
useExternalStateMonitoris true. Default is 100ms. (Android only) - videoStreams
- Video transcoding configuration.
Takes effect only when
contentViewis set to 0. When the SDK manages the views, all video streams are placed in the root view of the picture-in-picture window. (iOS only) - contentViewLayout
- Layout configuration for picture-in-picture video streams.
Takes effect only when
contentViewis set to 0. (iOS only) - sourceContentView
sourceContentViewdetermines the source frame and restore target for picture-in-picture animation. Pass 0 to use the app's root view. For best animation experience, set this to the view containing video content. The system uses this view for enter/exit animations and as the restore target when returning to the app or stopping picture-in-picture.- contentView
contentViewdetermines which view will be displayed in the picture-in-picture window. If 0 is passed, the picture-in-picture controller automatically manages and displays all video streams. If a specific view ID is passed, you are responsible for managing the content displayed in the picture-in-picture window.- preferredContentWidth
- Preferred width of the picture-in-picture content. (iOS only)
- preferredContentHeight
- Preferred height of the picture-in-picture content. (iOS only)
- controlStyle
- Control style of the picture-in-picture window.
Available styles:
- 0: Show all system controls (default)
- 1: Hide forward and back buttons
- 2: Hide play/pause button and progress bar (recommended)
- 3: Hide all system controls, including close and restore buttons