openharmony 鸿蒙 capi-oh-window-pip-h

2025-06-12 浏览 (1)

oh_window_pip.h

Overview

The oh_window_pip.h file declares the APIs related to the Picture in Picture (PiP) feature, including creating and deleting a PiP controller, and starting and stopping PiP. PiP is mainly used in video playback, live streaming, video calls, or video meetings.

File to include: <window_manager/oh_window_pip.h>

Library: libnative_window_manager.so

System capability: SystemCapability.Window.SessionManager

Since: 20

Related module: WindowManager

Summary

Enums

Nametypedef KeywordDescription
PictureInPicture_PipTemplateTypePictureInPicture_PipTemplateTypeEnumerates the types of PiP templates.
PictureInPicture_PipControlGroupPictureInPicture_PipControlGroupEnumerates the types of component groups displayed on the PiP controller.
PictureInPicture_PipControlTypePictureInPicture_PipControlTypeEnumerates the types of components displayed on the PiP controller.
PictureInPicture_PipControlStatusPictureInPicture_PipControlStatusEnumerates the statuses of components displayed on the PiP controller.
PictureInPicture_PipStatePictureInPicture_PipStateEnumerates the PiP lifecycle states.

Functions

Nametypedef KeywordDescription
typedef void (*WebPipStartPipCallback)(uint32_t controllerId, uint8_t requestId, uint64_t surfaceId)WebPipStartPipCallbackDefines a callback function for PiP window creation.
typedef void (*WebPipLifecycleCallback)(uint32_t controllerId, PictureInPicture_PipState state, int32_t errcode)WebPipLifecycleCallbackDefines a callback function for PiP window lifecycle changes.
typedef void (*WebPipControlEventCallback)(uint32_t controllerId, PictureInPicture_PipControlType controlType,PictureInPicture_PipControlStatus status)WebPipControlEventCallbackDefines a callback function for the component click event of the PiP window.
typedef void (*WebPipResizeCallback)(uint32_t controllerId, uint32_t width, uint32_t height, double scale)WebPipResizeCallbackDefines a callback function for PiP window size changes.
int32_t OH_PictureInPicture_CreatePipConfig(PictureInPicture_PipConfig* pipConfig)-Creates a PiP configuration.
int32_t OH_PictureInPicture_DestroyPipConfig(PictureInPicture_PipConfig* pipConfig)-Destroys a PiP configuration.
int32_t OH_PictureInPicture_SetPipMainWindowId(PictureInPicture_PipConfig pipConfig, uint32_t mainWindowId)-Sets the ID of the main window that launches PiP.
int32_t OH_PictureInPicture_SetPipTemplateType(PictureInPicture_PipConfig pipConfig,PictureInPicture_PipTemplateType pipTemplateType)-Sets the PiP template type. The default value is video playback.
int32_t OH_PictureInPicture_SetPipRect(PictureInPicture_PipConfig pipConfig, uint32_t width, uint32_t height)-Sets the size of the PiP window for calculating the aspect ratio.
int32_t OH_PictureInPicture_SetPipControlGroup(PictureInPicture_PipConfig pipConfig,PictureInPicture_PipControlGroup* controlGroup, uint8_t controlGroupLength)-Sets a PiP component group, which must match the template type.
int32_t OH_PictureInPicture_SetPipNapiEnv(PictureInPicture_PipConfig pipConfig, void* env)-Sets the runtime environment for launching PiP.
int32_t OH_PictureInPicture_CreatePip(PictureInPicture_PipConfig pipConfig, uint32_t* controllerId)-Creates a PiP controller.
int32_t OH_PictureInPicture_DeletePip(uint32_t controllerId)-Deletes a PiP controller.
int32_t OH_PictureInPicture_StartPip(uint32_t controllerId)-Starts PiP.
int32_t OH_PictureInPicture_StopPip(uint32_t controllerId)-Stops PiP.
int32_t OH_PictureInPicture_UpdatePipContentSize(uint32_t controllerId, uint32_t width, uint32_t height)-Updates the media content size when the media content changes.
int32_t OH_PictureInPicture_UpdatePipControlStatus(uint32_t controllerId, PictureInPicture_PipControlType controlType,PictureInPicture_PipControlStatus status)-Updates the PiP component status.
int32_t OH_PictureInPicture_SetPipControlEnabled(uint32_t controllerId, PictureInPicture_PipControlType controlType,bool enabled)-Sets the PiP component enabled status.
int32_t OH_PictureInPicture_RegisterStartPipCallback(uint32_t controllerId, WebPipStartPipCallback callback)-Registers a callback function for PiP window creation.
int32_t OH_PictureInPicture_UnregisterStartPipCallback(uint32_t controllerId, WebPipStartPipCallback callback)-Unregisters a single callback function for PiP window creation.
int32_t OH_PictureInPicture_UnregisterAllStartPipCallbacks(uint32_t controllerId)-Unregisters all callback functions for PiP window creation.
int32_t OH_PictureInPicture_RegisterLifecycleListener(uint32_t controllerId, WebPipLifecycleCallback callback)-Registers a callback function for PiP window lifecycle changes.
int32_t OH_PictureInPicture_UnregisterLifecycleListener(uint32_t controllerId, WebPipLifecycleCallback callback)-Unregisters a single callback function for PiP window lifecycle changes.
int32_t OH_PictureInPicture_UnregisterAllLifecycleListeners(uint32_t controllerId)-Unregisters all callback functions for PiP window lifecycle changes.
int32_t OH_PictureInPicture_RegisterControlEventListener(uint32_t controllerId, WebPipControlEventCallback callback)-Registers a callback function for the component click event of the PiP window.
int32_t OH_PictureInPicture_UnregisterControlEventListener(uint32_t controllerId, WebPipControlEventCallback callback)-Unregisters a single callback function for the component click event of the PiP window.
int32_t OH_PictureInPicture_UnregisterAllControlEventListeners(uint32_t controllerId)-Unregisters all callback functions for the component click event of the PiP window.
int32_t OH_PictureInPicture_RegisterResizeListener(uint32_t controllerId, WebPipResizeCallback callback)-Registers a callback function for PiP window size changes.
int32_t OH_PictureInPicture_UnregisterResizeListener(uint32_t controllerId, WebPipResizeCallback callback)-Unregisters a single callback function for PiP window size changes.
int32_t OH_PictureInPicture_UnregisterAllResizeListeners(uint32_t controllerId)-Unregisters all callback functions for PiP window size changes.

Enum Description

PictureInPicture_PipTemplateType

enum PictureInPicture_PipTemplateType

Description

Enumerates the types of PiP templates.

Since: 20

Enum ItemDescription
VIDEO_PLAY = 0Video playback template. A PiP window will be started during video playback, and the video playback template is loaded.
VIDEO_CALL = 1Video call template. A PiP window will be started during a video call, and the video call template will be loaded.
VIDEO_MEETING = 2Video meeting template. A PiP window will be started during a video meeting, and the video meeting template will be loaded.
VIDEO_LIVE = 3Live template. A PiP window will be started during a live, and the live template is loaded.

PictureInPicture_PipControlGroup

enum PictureInPicture_PipControlGroup

Description

Enumerates the types of component groups displayed on the PiP controller.

Since: 20

Enum ItemDescription
VIDEO_PLAY_VIDEO_PREVIOUS_NEXT = 101Previous/Next component group for video playback. This component group is mutually exclusive with the fast-forward/rewind component group. It cannot be added if the fast-forward/rewind component group is added.
VIDEO_PLAY_FAST_FORWARD_BACKWARD = 102Fast-forward/Rewind component group for video playback. This component group is mutually exclusive with the previous/next component group. It cannot be added if the previous/next component group is added.
VIDEO_CALL_MICROPHONE_SWITCH = 201Microphone on/off component group for video calls.
VIDEO_CALL_HANG_UP_BUTTON = 202Hang-up component group for video calls.
VIDEO_CALL_CAMERA_SWITCH = 203Camera on/off component group for video calls.
VIDEO_CALL_MUTE_SWITCH = 204Mute component group for video calls.
VIDEO_MEETING_HANG_UP_BUTTON = 301Hang-up component group for video meetings.
VIDEO_MEETING_CAMERA_SWITCH = 302Camera on/off component group for video meetings.
VIDEO_MEETING_MUTE_SWITCH = 303Mute component group for video meetings.
VIDEO_MEETING_MICROPHONE_SWITCH = 304Microphone on/off component group for video meetings.
VIDEO_LIVE_VIDEO_PLAY_PAUSE = 401Play/Pause component group for live streaming.
VIDEO_LIVE_MUTE_SWITCH = 402Mute component group for live streaming.

PictureInPicture_PipControlType

enum PictureInPicture_PipControlType

Description

Enumerates the types of components displayed on the PiP controller.

Since: 20

Enum ItemDescription
VIDEO_PLAY_PAUSE = 0Play/Pause component.
VIDEO_PREVIOUS = 1Previous component in video scenarios.
VIDEO_NEXT = 2Next component in video scenarios.
FAST_FORWARD = 3Fast-forward component in video scenarios.
FAST_BACKWARD = 4Rewind component in video scenarios.
HANG_UP_BUTTON = 5Hang-up component.
MICROPHONE_SWITCH = 6Microphone on/off component.
CAMERA_SWITCH = 7Camera on/off component.
MUTE_SWITCH = 8Mute/Unmute component.

PictureInPicture_PipControlStatus

enum PictureInPicture_PipControlStatus

Description

Enumerates the statuses of components displayed on the PiP controller.

Since: 20

Enum ItemDescription
PLAY = 1A video is playing.
PAUSE = 0A video is paused.
OPEN = 1The camera, microphone, and mute components are enabled.
CLOSE = 0The camera, microphone, and mute components are disabled.

PictureInPicture_PipState

enum PictureInPicture_PipState

Description

Enumerates the PiP lifecycle states.

Since: 20

Enum ItemDescription
ABOUT_TO_START = 1PiP is about to start.
STARTED = 2PiP is started.
ABOUT_TO_STOP = 3PiP is about to stop.
STOPPED = 4PiP is stopped.
ABOUT_TO_RESTORE = 5The original page is about to restore.
ERROR = 6An error occurs during the execution of the PiP lifecycle.

Function Description

WebPipStartPipCallback()

typedef void (*WebPipStartPipCallback)(uint32_t controllerId, uint8_t requestId, uint64_t surfaceId)

Description

Defines a callback function for PiP window creation.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
uint8_t requestIdRequest ID, which indicates the number of times the PiP window has been requested to be pulled up.
uint64_t surfaceIdSurface ID of the XComponent in PiP. It is used for application rendering.

WebPipLifecycleCallback()

typedef void (*WebPipLifecycleCallback)(uint32_t controllerId, PictureInPicture_PipState state, int32_t errcode)

Description

Defines a callback function for PiP window lifecycle changes.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
PictureInPicture_PipState statePiP lifecycle state.
int32_t errcodeCommon status codes of PiP APIs. For details, see WindowManager_ErrorCode.

WebPipControlEventCallback()

typedef void (*WebPipControlEventCallback)(uint32_t controllerId, PictureInPicture_PipControlType controlType, PictureInPicture_PipControlStatus status)

Description

Defines a callback function for the component click event of the PiP window.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
PictureInPicture_PipControlType controlTypeType of component displayed on the PiP controller.
PictureInPicture_PipControlStatus statusStatus of the component displayed on the PiP controller.

WebPipResizeCallback()

typedef void (*WebPipResizeCallback)(uint32_t controllerId, uint32_t width, uint32_t height, double scale)

Description

Defines a callback function for PiP window size changes.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
uint32_t widthPiP window width, in px. The value is a positive integer and cannot be greater than the screen width.
uint32_t heightPiP window height, in px. The value is a positive integer and cannot be greater than the screen height.
double scaleScale factor of the PiP window, representing the display size relative to the width and height. The value is a floating point number in the range (0.0, 1.0]. The value 1 means that the PiP window matches the specified width and height.

OH_PictureInPicture_CreatePipConfig()

int32_t OH_PictureInPicture_CreatePipConfig(PictureInPicture_PipConfig* pipConfig)

Description

Creates a PiP configuration.

Since: 20

Parameters

ParameterDescription
PictureInPicture_PipConfig* pipConfigPointer to the PiP parameter configuration.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.

OH_PictureInPicture_DestroyPipConfig()

int32_t OH_PictureInPicture_DestroyPipConfig(PictureInPicture_PipConfig* pipConfig)

Description

Destroys a PiP configuration.

Since: 20

Parameters

ParameterDescription
PictureInPicture_PipConfig* pipConfigPointer to the PiP configuration.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.

OH_PictureInPicture_SetPipMainWindowId()

int32_t OH_PictureInPicture_SetPipMainWindowId(PictureInPicture_PipConfig pipConfig, uint32_t mainWindowId)

Description

Sets the ID of the main window that launches PiP.

Since: 20

Parameters

ParameterDescription
PictureInPicture_PipConfig pipConfigPiP configuration.
uint32_t mainWindowIdID of the main window that launches PiP.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.

OH_PictureInPicture_SetPipTemplateType()

int32_t OH_PictureInPicture_SetPipTemplateType(PictureInPicture_PipConfig pipConfig, PictureInPicture_PipTemplateType pipTemplateType)

Description

Sets the PiP template type. The default value is video playback.

Since: 20

Parameters

ParameterDescription
PictureInPicture_PipConfig pipConfigPiP configuration.
PictureInPicture_PipTemplateType pipTemplateTypeType of the PiP template.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.

OH_PictureInPicture_SetPipRect()

int32_t OH_PictureInPicture_SetPipRect(PictureInPicture_PipConfig pipConfig, uint32_t width, uint32_t height)

Description

Sets the size of the PiP window for calculating the aspect ratio.

Since: 20

Parameters

ParameterDescription
PictureInPicture_PipConfig pipConfigPiP configuration.
uint32_t widthWidth of the original content, in px. The value must be a positive integer. It is used to determine the aspect ratio of the PiP window.
uint32_t heightHeight of the original content, in px. The value must be a positive integer. It is used to determine the aspect ratio of the PiP window.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.

OH_PictureInPicture_SetPipControlGroup()

int32_t OH_PictureInPicture_SetPipControlGroup(PictureInPicture_PipConfig pipConfig, PictureInPicture_PipControlGroup* controlGroup, uint8_t controlGroupLength)

Description

Sets a PiP component group, which must match the template type.

Since: 20

Parameters

ParameterDescription
PictureInPicture_PipConfig pipConfigPiP configuration.
PictureInPicture_PipControlGroup* controlGroupPointer to an optional component group of the PiP controller. An application can configure whether to display these optional components. If this parameter is not set for an application, the basic components (for example, play/pause of the video playback component group) are displayed. A maximum of three components can be configured.
uint8_t controlGroupLengthNumber of components in the PiP component group. The value ranges from 0 to 3.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.

OH_PictureInPicture_SetPipNapiEnv()

int32_t OH_PictureInPicture_SetPipNapiEnv(PictureInPicture_PipConfig pipConfig, void* env)

Description

Sets the runtime environment for launching PiP.

Since: 20

Parameters

ParameterDescription
PictureInPicture_PipConfig pipConfigPiP configuration.
void* envPointer to the NAPI environment.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.

OH_PictureInPicture_CreatePip()

int32_t OH_PictureInPicture_CreatePip(PictureInPicture_PipConfig pipConfig, uint32_t* controllerId)

Description

Creates a PiP controller.

Since: 20

Parameters

ParameterDescription
PictureInPicture_PipConfig pipConfigPiP configuration.
uint32_t* controllerIdPointer to the ID of the PiP controller created.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.
WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_DeletePip()

int32_t OH_PictureInPicture_DeletePip(uint32_t controllerId)

Description

Deletes a PiP controller.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.

OH_PictureInPicture_StartPip()

int32_t OH_PictureInPicture_StartPip(uint32_t controllerId)

Description

Starts PiP.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_PIP_STATE_ABNORMAL: The PiP window is abnormal.
WINDOW_MANAGER_ERRORCODE_PIP_CREATE_FAILED: Creating the PiP window fails.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.
WINDOW_MANAGER_ERRORCODE_PIP_REPEAT_OPERATION: The PiP window is manipulated repeatedly.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.

OH_PictureInPicture_StopPip()

int32_t OH_PictureInPicture_StopPip(uint32_t controllerId)

Description

Stops PiP.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_PIP_DESTROY_FAILED: Destroying the PiP window fails.
WINDOW_MANAGER_ERRORCODE_PIP_STATE_ABNORMAL: The PiP window is abnormal.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.
WINDOW_MANAGER_ERRORCODE_PIP_REPEAT_OPERATION: The PiP window is manipulated repeatedly.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.

OH_PictureInPicture_UpdatePipContentSize()

int32_t OH_PictureInPicture_UpdatePipContentSize(uint32_t controllerId, uint32_t width, uint32_t height)

Description

Updates the media content size when the media content changes.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
uint32_t widthWidth of the media content, in px. The value must be a positive integer. It is used to update the aspect ratio of the PiP window.
uint32_t heightHeight of the media content, in px. The value must be a positive integer. It is used to update the aspect ratio of the PiP window.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_UpdatePipControlStatus()

int32_t OH_PictureInPicture_UpdatePipControlStatus(uint32_t controllerId, PictureInPicture_PipControlType controlType, PictureInPicture_PipControlStatus status)

Description

Updates the PiP component status.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
PictureInPicture_PipControlType controlTypeType of the component displayed on the PiP controller. Currently, only VIDEO_PLAY_PAUSE, MICROPHONE_SWITCH, CAMERA_SWITCH, and MUTE_SWITCH are supported.
PictureInPicture_PipControlStatus statusStatus of the component displayed on the PiP controller.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_SetPipControlEnabled()

int32_t OH_PictureInPicture_SetPipControlEnabled(uint32_t controllerId, PictureInPicture_PipControlType controlType, bool enabled)

Description

Sets the PiP component enabled status.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
PictureInPicture_PipControlType controlTypeType of the component displayed on the PiP controller.
bool enabledEnabled status of the component displayed on the PiP controller. The value true means that the component is enabled, and false means the opposite.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_RegisterStartPipCallback()

int32_t OH_PictureInPicture_RegisterStartPipCallback(uint32_t controllerId, WebPipStartPipCallback callback)

Description

Registers a callback function for PiP window creation.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
WebPipStartPipCallback callbackCallback function for PiP window creation.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_UnregisterStartPipCallback()

int32_t OH_PictureInPicture_UnregisterStartPipCallback(uint32_t controllerId, WebPipStartPipCallback callback)

Description

Unregisters a single callback function for PiP window creation.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
WebPipStartPipCallback callbackCallback function for PiP window creation.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_UnregisterAllStartPipCallbacks()

int32_t OH_PictureInPicture_UnregisterAllStartPipCallbacks(uint32_t controllerId)

Description

Unregisters all callback functions for PiP window creation.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_RegisterLifecycleListener()

int32_t OH_PictureInPicture_RegisterLifecycleListener(uint32_t controllerId, WebPipLifecycleCallback callback)

Description

Registers a callback function for PiP window lifecycle changes.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
WebPipLifecycleCallback callbackCallback function for PiP window lifecycle changes.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_UnregisterLifecycleListener()

int32_t OH_PictureInPicture_UnregisterLifecycleListener(uint32_t controllerId, WebPipLifecycleCallback callback)

Description

Unregisters a single callback function for PiP window lifecycle changes.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
WebPipLifecycleCallback callbackCallback function for PiP window lifecycle changes.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_UnregisterAllLifecycleListeners()

int32_t OH_PictureInPicture_UnregisterAllLifecycleListeners(uint32_t controllerId)

Description

Unregisters all callback functions for PiP window lifecycle changes.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_RegisterControlEventListener()

int32_t OH_PictureInPicture_RegisterControlEventListener(uint32_t controllerId, WebPipControlEventCallback callback)

Description

Registers a callback function for the component click event of the PiP window.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
WebPipControlEventCallback callbackCallback function for the component click event of the PiP window.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_UnregisterControlEventListener()

int32_t OH_PictureInPicture_UnregisterControlEventListener(uint32_t controllerId, WebPipControlEventCallback callback)

Description

Unregisters a single callback function for the component click event of the PiP window.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
WebPipControlEventCallback callbackCallback function for the component click event of the PiP window.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_UnregisterAllControlEventListeners()

int32_t OH_PictureInPicture_UnregisterAllControlEventListeners(uint32_t controllerId)

Description

Unregisters all callback functions for the component click event of the PiP window.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_RegisterResizeListener()

int32_t OH_PictureInPicture_RegisterResizeListener(uint32_t controllerId, WebPipResizeCallback callback)

Description

Registers a callback function for PiP window size changes.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
WebPipResizeCallback callbackCallback function for PiP window size changes.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_UnregisterResizeListener()

int32_t OH_PictureInPicture_UnregisterResizeListener(uint32_t controllerId, WebPipResizeCallback callback)

Description

Unregisters a single callback function for PiP window size changes.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.
WebPipResizeCallback callbackCallback function for PiP window size changes.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

OH_PictureInPicture_UnregisterAllResizeListeners()

int32_t OH_PictureInPicture_UnregisterAllResizeListeners(uint32_t controllerId)

Description

Unregisters all callback functions for PiP window size changes.

Since: 20

Parameters

ParameterDescription
uint32_t controllerIdID of the PiP controller. The value is a non-negative integer.

Return value

TypeDescription
int32_tOne of the following result codes:
OK: The function is successfully called.
WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: A parameter is incorrect.
WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: The device does not support PiP.
WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR: An internal error occurs in PiP.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkUI

harmony 鸿蒙ARKUI_TextPickerCascadeRangeContent

harmony 鸿蒙ARKUI_TextPickerRangeContent

harmony 鸿蒙ArkUI_AnimateCompleteCallback

harmony 鸿蒙ArkUI_AttributeItem

harmony 鸿蒙ArkUI_ColorStop

harmony 鸿蒙ArkUI_ContextCallback

harmony 鸿蒙ArkUI_EventModule

harmony 鸿蒙ArkUI_ExpectedFrameRateRange

harmony 鸿蒙ArkUI_IntOffset

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/BxQnrx