未验证 提交 d8fda992 编写于 作者: O openharmony_ci 提交者: Gitee

!19448 翻译完成:18965 AVSession 文档同步.d.ts的修改

Merge pull request !19448 from wusongqing/TR18965
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
- Selecting and Saving User Files (FilePicker) - Selecting and Saving User Files (FilePicker)
- [Selecting User Files](select-user-file.md) - [Selecting User Files](select-user-file.md)
- [Saving User Files](save-user-file.md) - [Saving User Files](save-user-file.md)
- [Developing a FileManager Application (Available Only for System Applications)](dev-user-file-manager.md) - [Developing a FileManager Application (for System Applications Only)](dev-user-file-manager.md)
- [Managing External Storage Devices (Available Only for System Applications)](manage-external-storage.md) - [Managing External Storage Devices (for System Applications Only)](manage-external-storage.md)
- Distributed File System - Distributed File System
- [Distributed File System Overview](distributed-fs-overview.md) - [Distributed File System Overview](distributed-fs-overview.md)
- [Setting the Security Level of a Distributed File](set-security-label.md) - [Setting the Security Level of a Distributed File](set-security-label.md)
......
# Developing a FileManager Application (Available Only for System Applications) # Developing a FileManager Application (for System Applications Only)
OpenHarmony is prebuilt with the **FileManager** application. You can also develop your own **FileManager** as required. OpenHarmony is prebuilt with the **FileManager** application. You can also develop your own **FileManager** as required.
......
# Managing External Storage Devices (Available Only for System Applications) # Managing External Storage Devices (for System Applications Only)
External storage devices are pluggable. OpenHarmony provides the functions of listening for the device insertion and removal events and mounting/unmounting an external storage device. External storage devices are pluggable. OpenHarmony provides the functions of listening for the device insertion and removal events and mounting/unmounting an external storage device.
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
- [Developing Audio Call](audio-call-development.md) - [Developing Audio Call](audio-call-development.md)
- [Video Playback](video-playback.md) - [Video Playback](video-playback.md)
- [Video Recording](video-recording.md) - [Video Recording](video-recording.md)
- AVSession (for System Applications Only) - AVSession
- [AVSession Overview](avsession-overview.md) - [AVSession Overview](avsession-overview.md)
- Local AVSession - Local AVSession
- [Local AVSession Overview](local-avsession-overview.md) - [Local AVSession Overview](local-avsession-overview.md)
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
- Distributed AVSession - Distributed AVSession
- [Distributed AVSession Overview](distributed-avsession-overview.md) - [Distributed AVSession Overview](distributed-avsession-overview.md)
- [Using Distributed AVSession](using-distributed-avsession.md) - [Using Distributed AVSession](using-distributed-avsession.md)
- Camera (for System Applications Only) - Camera
- [Camera Overview](camera-overview.md) - [Camera Overview](camera-overview.md)
- Camera Development - Camera Development
- [Camera Development Preparations](camera-preparation.md) - [Camera Development Preparations](camera-preparation.md)
......
...@@ -26,11 +26,7 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md). ...@@ -26,11 +26,7 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md).
| -------- | -------- | | -------- | -------- |
| getAllSessionDescriptors(callback: AsyncCallback<Array<Readonly<AVSessionDescriptor>>>): void | Obtains the descriptors of all AVSessions in the system.| | getAllSessionDescriptors(callback: AsyncCallback<Array<Readonly<AVSessionDescriptor>>>): void | Obtains the descriptors of all AVSessions in the system.|
| createController(sessionId: string, callback: AsyncCallback<AVSessionController>): void | Creates an AVSessionController.| | createController(sessionId: string, callback: AsyncCallback<AVSessionController>): void | Creates an AVSessionController.|
| getValidCommands(callback: AsyncCallback&lt;Array&lt;AVControlCommandType&gt;&gt;): void | Obtains valid commands supported by the AVSession.<br>Playback control commands listened by an audio and video application when it accesses the AVSession are considered as valid commands supported by the AVSession. For details, see [Provider of AVSession](using-avsession-developer.md).|
| getLaunchAbility(callback: AsyncCallback&lt;WantAgent&gt;): void | Obtains the UIAbility that is configured in the AVSession and can be started.<br>The UIAbility configured here is started when a user operates the UI of the controller, for example, clicking a widget in Media Controller.|
| sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback&lt;void&gt;): void | Sends a key event to an AVSession through the AVSessionController object.|
| sendSystemAVKeyEvent(event: KeyEvent, callback: AsyncCallback&lt;void&gt;): void | Sends a key event to the top session.| | sendSystemAVKeyEvent(event: KeyEvent, callback: AsyncCallback&lt;void&gt;): void | Sends a key event to the top session.|
| sendControlCommand(command: AVControlCommand, callback: AsyncCallback&lt;void&gt;): void | Sends a playback control command to an AVSession through the AVSessionController object.|
| sendSystemControlCommand(command: AVControlCommand, callback: AsyncCallback&lt;void&gt;): void | Sends a playback control command to the top session.| | sendSystemControlCommand(command: AVControlCommand, callback: AsyncCallback&lt;void&gt;): void | Sends a playback control command to the top session.|
| getHistoricalSessionDescriptors(maxSize: number, callback: AsyncCallback\<Array\<Readonly\<AVSessionDescriptor>>>): void<sup>10+<sup> | Obtains the descriptors of historical sessions.| | getHistoricalSessionDescriptors(maxSize: number, callback: AsyncCallback\<Array\<Readonly\<AVSessionDescriptor>>>): void<sup>10+<sup> | Obtains the descriptors of historical sessions.|
...@@ -38,15 +34,15 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md). ...@@ -38,15 +34,15 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md).
| API| Description| | API| Description|
| -------- | -------- | | -------- | -------- |
| getAVPlaybackState(callback: AsyncCallback&lt;AVPlaybackState&gt;): void | Obtains the information related to the playback state.| | getAVPlaybackState(callback: AsyncCallback&lt;AVPlaybackState&gt;): void<sup>10+<sup> | Obtains the information related to the playback state.|
| getAVMetadata(callback: AsyncCallback&lt;AVMetadata&gt;): void | Obtains the session metadata.| | getAVMetadata(callback: AsyncCallback&lt;AVMetadata&gt;): void<sup>10+<sup> | Obtains the session metadata.|
| getOutputDevice(callback: AsyncCallback&lt;OutputDeviceInfo&gt;): void | Obtains the output device information.| | getOutputDevice(callback: AsyncCallback&lt;OutputDeviceInfo&gt;): void<sup>10+<sup> | Obtains the output device information.|
| sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback&lt;void&gt;): void | Sends a key event to the session corresponding to this controller.| | sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sends a key event to the session corresponding to this controller.|
| getLaunchAbility(callback: AsyncCallback&lt;WantAgent&gt;): void | Obtains the **WantAgent** object saved by the application in the session.| | getLaunchAbility(callback: AsyncCallback&lt;WantAgent&gt;): void<sup>10+<sup> | Obtains the **WantAgent** object saved by the application in the session.|
| isActive(callback: AsyncCallback&lt;boolean&gt;): void | Checks whether the session is activated.| | isActive(callback: AsyncCallback&lt;boolean&gt;): void<sup>10+<sup> | Checks whether the session is activated.|
| destroy(callback: AsyncCallback&lt;void&gt;): void | Destroys this controller. A controller can no longer be used after being destroyed.| | destroy(callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Destroys this controller. A controller can no longer be used after being destroyed.|
| getValidCommands(callback: AsyncCallback&lt;Array&lt;AVControlCommandType&gt;&gt;): void | Obtains valid commands supported by the session.| | getValidCommands(callback: AsyncCallback&lt;Array&lt;AVControlCommandType&gt;&gt;): void<sup>10+<sup> | Obtains valid commands supported by the session.|
| sendControlCommand(command: AVControlCommand, callback: AsyncCallback&lt;void&gt;): void | Sends a playback control command to the session through the controller.| | sendControlCommand(command: AVControlCommand, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sends a playback control command to the session through the controller.|
| sendCommonCommand(command: string, args: {[key: string]: Object}, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sends a custom playback control command to the session through the controller.| | sendCommonCommand(command: string, args: {[key: string]: Object}, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sends a custom playback control command to the session through the controller.|
| getAVQueueItems(callback: AsyncCallback&lt;Array&lt;AVQueueItem&gt;&gt;): void<sup>10+<sup> | Obtains the information related to the items in the playlist.| | getAVQueueItems(callback: AsyncCallback&lt;Array&lt;AVQueueItem&gt;&gt;): void<sup>10+<sup> | Obtains the information related to the items in the playlist.|
| getAVQueueTitle(callback: AsyncCallback&lt;string&gt;): void<sup>10+<sup> | Obtains the name of the playlist.| | getAVQueueTitle(callback: AsyncCallback&lt;string&gt;): void<sup>10+<sup> | Obtains the name of the playlist.|
......
...@@ -16,15 +16,15 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md). ...@@ -16,15 +16,15 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md).
| API| Description| | API| Description|
| -------- | -------- | | -------- | -------- |
| createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback&lt;AVSession&gt;): void | Creates an AVSession.<br>Only one AVSession can be created for a UIAbility.| | createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback&lt;AVSession&gt;): void<sup>10+<sup> | Creates an AVSession.<br>Only one AVSession can be created for a UIAbility.|
| setAVMetadata(data: AVMetadata, callback: AsyncCallback&lt;void&gt;): void | Sets AVSession metadata.| | setAVMetadata(data: AVMetadata, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sets AVSession metadata.|
| setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback&lt;void&gt;): void | Sets the AVSession playback state.| | setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sets the AVSession playback state.|
| setLaunchAbility(ability: WantAgent, callback: AsyncCallback&lt;void&gt;): void | Starts a UIAbility.| | setLaunchAbility(ability: WantAgent, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Starts a UIAbility.|
| getController(callback: AsyncCallback&lt;AVSessionController&gt;): void | Obtains the controller of the AVSession.| | getController(callback: AsyncCallback&lt;AVSessionController&gt;): void<sup>10+<sup> | Obtains the controller of the AVSession.|
| getOutputDevice(callback: AsyncCallback&lt;OutputDeviceInfo&gt;): void | Obtains the output device information.| | getOutputDevice(callback: AsyncCallback&lt;OutputDeviceInfo&gt;): void<sup>10+<sup> | Obtains the output device information.|
| activate(callback: AsyncCallback&lt;void&gt;): void | Activates the AVSession.| | activate(callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Activates the AVSession.|
| deactivate(callback: AsyncCallback&lt;void&gt;): void | Deactivates this session.| | deactivate(callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Deactivates this session.|
| destroy(callback: AsyncCallback&lt;void&gt;): void | Destroys the AVSession.| | destroy(callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Destroys the AVSession.|
| setAVQueueItems(items: Array&lt;AVQueueItem&gt;, callback: AsyncCallback&lt;void&gt;): void <sup>10+<sup> | Sets a playlist.| | setAVQueueItems(items: Array&lt;AVQueueItem&gt;, callback: AsyncCallback&lt;void&gt;): void <sup>10+<sup> | Sets a playlist.|
| setAVQueueTitle(title: string, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sets a name for the playlist.| | setAVQueueTitle(title: string, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Sets a name for the playlist.|
| dispatchSessionEvent(event: string, args: {[key: string]: Object}, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Dispatches a custom session event.| | dispatchSessionEvent(event: string, args: {[key: string]: Object}, callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Dispatches a custom session event.|
...@@ -344,7 +344,6 @@ To enable an audio and video application to access the AVSession service as a pr ...@@ -344,7 +344,6 @@ To enable an audio and video application to access the AVSession service as a pr
} }
``` ```
The code snippet below is used for destroying the AVSession object: The code snippet below is used for destroying the AVSession object:
```ts ```ts
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
- [HAR](har-package.md) - [HAR](har-package.md)
- HSP - HSP
- [In-Application HSP Development](in-app-hsp.md) - [In-Application HSP Development](in-app-hsp.md)
- [Inter-Application HSP Development (for System Applications Only)](cross-app-hsp.md) - [Inter-Application HSP Development](cross-app-hsp.md)
- Atomic Service - Atomic Service
- [Atomic Service Development](atomicService.md) - [Atomic Service Development](atomicService.md)
- [Atomic Service Space Management (for System Applications Only)](atomicService-aging.md) - [Atomic Service Space Management (for System Applications Only)](atomicService-aging.md)
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
- [Common Events of the Ability Subsystem](commonEvent-ability.md) - [Common Events of the Ability Subsystem](commonEvent-ability.md)
- [Common Events of the Bundle Management Subsystem](commonEvent-bundleManager.md) - [Common Events of the Bundle Management Subsystem](commonEvent-bundleManager.md)
- [Common Events of the Notification Service](commonEvent-ans.md) - [Common Events of the Notification Service](commonEvent-ans.md)
- [Common Events of the Resource Scheduling Subsystem](commonEvent-resourceschedule.md) - [Common Events of the Resource Scheduler Subsystem](commonEvent-resourceschedule.md)
- [Common Events of the Telephony Subsystem](commonEvent-telephony.md) - [Common Events of the Telephony Subsystem](commonEvent-telephony.md)
- [Common Events of the USB Subsystem](commonEvent-usb.md) - [Common Events of the USB Subsystem](commonEvent-usb.md)
# Common Events of the Resource Scheduling Subsystem # Common Events of the Resource Scheduler Subsystem
This document lists the common system events provided by the resource scheduling subsystem to applications. Applications can use [APIs](../js-apis-commonEventManager.md) to subscribe to common system events. This document lists the common system events provided by the resource scheduler subsystem to applications. Applications can use [APIs](../js-apis-commonEventManager.md) to subscribe to common system events.
## COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED ## COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED
Indicates that the system idle mode has changed. Indicates that the system idle mode has changed.
......
...@@ -4,14 +4,12 @@ The **avSession** module provides APIs for media playback control so that applic ...@@ -4,14 +4,12 @@ The **avSession** module provides APIs for media playback control so that applic
This module provides the following typical features related to media sessions: This module provides the following typical features related to media sessions:
- [AVSession](#avsession): used to set session metadata, playback state information, and more. - [AVSession](#avsession10): used to set session metadata, playback state information, and more.
- [AVSessionController](#avsessioncontroller): used to obtain session IDs, send commands and events to sessions, and obtain the session metadata and playback state information. - [AVSessionController](#avsessioncontroller10): used to obtain session IDs, send commands and events to sessions, and obtain the session metadata and playback state information.
> **NOTE** > **NOTE**
> >
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> All the APIs provided by this module are system APIs.
## Modules to Import ## Modules to Import
...@@ -19,7 +17,7 @@ This module provides the following typical features related to media sessions: ...@@ -19,7 +17,7 @@ This module provides the following typical features related to media sessions:
import avSession from '@ohos.multimedia.avsession'; import avSession from '@ohos.multimedia.avsession';
``` ```
## avSession.createAVSession ## avSession.createAVSession<sup>10+</sup>
createAVSession(context: Context, tag: string, type: AVSessionType): Promise\<AVSession> createAVSession(context: Context, tag: string, type: AVSessionType): Promise\<AVSession>
...@@ -27,22 +25,19 @@ Creates a media session. This API uses a promise to return the result. An abilit ...@@ -27,22 +25,19 @@ Creates a media session. This API uses a promise to return the result. An abilit
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------------------------------- | ---- | ------------------------------ | | ------ | ------------------------------- | ---- | ------------------------------ |
| context| [Context](js-apis-inner-app-context.md) | Yes| Application context, which provides application environment information.| | context| [Context](js-apis-inner-app-context.md) | Yes| Application context, which provides application environment information.|
| tag | string | Yes | Custom session name. | | tag | string | Yes | Custom session name. |
| type | [AVSessionType](#avsessiontype) | Yes | Session type, which can be audio or video.| | type | [AVSessionType](#avsessiontype10) | Yes | Session type, which can be audio or video.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------------------- | ------------------------------------------------------------ | | --------------------------------- | ------------------------------------------------------------ |
| Promise<[AVSession](#avsession)\> | Promise used to return the media session obtained, which can be used to obtain the session ID, set the metadata and playback state information, and send key events.| | Promise<[AVSession](#avsession10)\> | Promise used to return the media session obtained, which can be used to obtain the session ID, set the metadata and playback state information, and send key events.|
**Error codes** **Error codes**
...@@ -69,7 +64,7 @@ await avSession.createAVSession(context, tag, "audio").then((data) => { ...@@ -69,7 +64,7 @@ await avSession.createAVSession(context, tag, "audio").then((data) => {
}); });
``` ```
## avSession.createAVSession ## avSession.createAVSession<sup>10+</sup>
createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback\<AVSession>): void createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback\<AVSession>): void
...@@ -77,16 +72,14 @@ Creates a media session. This API uses an asynchronous callback to return the re ...@@ -77,16 +72,14 @@ Creates a media session. This API uses an asynchronous callback to return the re
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| context| [Context](js-apis-inner-app-context.md) | Yes| Application context, which provides application environment information. | | context| [Context](js-apis-inner-app-context.md) | Yes| Application context, which provides application environment information. |
| tag | string | Yes | Custom session name. | | tag | string | Yes | Custom session name. |
| type | [AVSessionType](#avsessiontype) | Yes | Session type, which can be audio or video. | | type | [AVSessionType](#avsessiontype10) | Yes | Session type, which can be audio or video. |
| callback | AsyncCallback<[AVSession](#avsession)\> | Yes | Callback used to return the media session obtained, which can be used to obtain the session ID, set the metadata and playback state information, and send key events.| | callback | AsyncCallback<[AVSession](#avsession10)\> | Yes | Callback used to return the media session obtained, which can be used to obtain the session ID, set the metadata and playback state information, and send key events.|
**Error codes** **Error codes**
...@@ -316,7 +309,7 @@ Creates a session controller based on the session ID. Multiple session controlle ...@@ -316,7 +309,7 @@ Creates a session controller based on the session ID. Multiple session controlle
| Type | Description | | Type | Description |
| ----------------------------------------------------- | ------------------------------------------------------------ | | ----------------------------------------------------- | ------------------------------------------------------------ |
| Promise<[AVSessionController](#avsessioncontroller)\> | Promise used to return the session controller created, which can be used to obtain the session ID,<br>send commands and events to sessions, and obtain metadata and playback state information.| | Promise<[AVSessionController](#avsessioncontroller10)\> | Promise used to return the session controller created, which can be used to obtain the session ID,<br>send commands and events to sessions, and obtain metadata and playback state information.|
**Error codes** **Error codes**
...@@ -369,7 +362,7 @@ Creates a session controller based on the session ID. Multiple session controlle ...@@ -369,7 +362,7 @@ Creates a session controller based on the session ID. Multiple session controlle
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | | --------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| sessionId | string | Yes | Session ID. | | sessionId | string | Yes | Session ID. |
| callback | AsyncCallback<[AVSessionController](#avsessioncontroller)\> | Yes | Callback used to return the session controller created, which can be used to obtain the session ID,<br>send commands and events to sessions, and obtain metadata and playback state information.| | callback | AsyncCallback<[AVSessionController](#avsessioncontroller10)\> | Yes | Callback used to return the session controller created, which can be used to obtain the session ID,<br>send commands and events to sessions, and obtain metadata and playback state information.|
**Error codes** **Error codes**
...@@ -777,7 +770,7 @@ Sends a system control command to the top session. This API uses a promise to re ...@@ -777,7 +770,7 @@ Sends a system control command to the top session. This API uses a promise to re
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ------------------------------------- | ---- | ----------------------------------- | | ------- | ------------------------------------- | ---- | ----------------------------------- |
| command | [AVControlCommand](#avcontrolcommand) | Yes | Command to send.| | command | [AVControlCommand](#avcontrolcommand10) | Yes | Command to send.|
**Return value** **Return value**
...@@ -837,7 +830,7 @@ Sends a system control command to the top session. This API uses an asynchronous ...@@ -837,7 +830,7 @@ Sends a system control command to the top session. This API uses an asynchronous
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | ------------------------------------- | | -------- | ------------------------------------- | ---- | ------------------------------------- |
| command | [AVControlCommand](#avcontrolcommand) | Yes | Command to send. | | command | [AVControlCommand](#avcontrolcommand10) | Yes | Command to send. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the command is sent, **err** is **undefined**; otherwise, **err** is an error object.| | callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the command is sent, **err** is **undefined**; otherwise, **err** is an error object.|
**Error codes** **Error codes**
...@@ -878,17 +871,14 @@ avSession.sendSystemControlCommand(avcommand, function (err) { ...@@ -878,17 +871,14 @@ avSession.sendSystemControlCommand(avcommand, function (err) {
}); });
``` ```
## AVSession ## AVSession<sup>10+</sup>
An **AVSession** object is created by calling [avSession.createAVSession](#avsessioncreateavsession). The object enables you to obtain the session ID and set the metadata and playback state. An **AVSession** object is created by calling [avSession.createAVSession](#avsessioncreateavsession10). The object enables you to obtain the session ID and set the metadata and playback state.
### Attributes ### Attributes
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
| :-------- | :----- | :--- | :--- | :---------------------------- | | :-------- | :----- | :--- | :--- | :---------------------------- |
| sessionId | string | Yes | No | Unique session ID of the **AVSession** object.| | sessionId | string | Yes | No | Unique session ID of the **AVSession** object.|
...@@ -899,7 +889,7 @@ An **AVSession** object is created by calling [avSession.createAVSession](#avses ...@@ -899,7 +889,7 @@ An **AVSession** object is created by calling [avSession.createAVSession](#avses
let sessionId = session.sessionId; let sessionId = session.sessionId;
``` ```
### setAVMetadata ### setAVMetadata<sup>10+</sup>
setAVMetadata(data: AVMetadata): Promise\<void> setAVMetadata(data: AVMetadata): Promise\<void>
...@@ -907,13 +897,11 @@ Sets session metadata. This API uses a promise to return the result. ...@@ -907,13 +897,11 @@ Sets session metadata. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------------------------- | ---- | ------------ | | ------ | ------------------------- | ---- | ------------ |
| data | [AVMetadata](#avmetadata) | Yes | Session metadata.| | data | [AVMetadata](#avmetadata10) | Yes | Session metadata.|
**Return value** **Return value**
...@@ -956,7 +944,7 @@ session.setAVMetadata(metadata).then(() => { ...@@ -956,7 +944,7 @@ session.setAVMetadata(metadata).then(() => {
}); });
``` ```
### setAVMetadata ### setAVMetadata<sup>10+</sup>
setAVMetadata(data: AVMetadata, callback: AsyncCallback\<void>): void setAVMetadata(data: AVMetadata, callback: AsyncCallback\<void>): void
...@@ -964,13 +952,11 @@ Sets session metadata. This API uses an asynchronous callback to return the resu ...@@ -964,13 +952,11 @@ Sets session metadata. This API uses an asynchronous callback to return the resu
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ------------------------------------- | | -------- | ------------------------- | ---- | ------------------------------------- |
| data | [AVMetadata](#avmetadata) | Yes | Session metadata. | | data | [AVMetadata](#avmetadata10) | Yes | Session metadata. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the setting is successful, **err** is **undefined**; otherwise, **err** is an error object.| | callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the setting is successful, **err** is **undefined**; otherwise, **err** is an error object.|
**Error codes** **Error codes**
...@@ -1010,7 +996,7 @@ session.setAVMetadata(metadata, function (err) { ...@@ -1010,7 +996,7 @@ session.setAVMetadata(metadata, function (err) {
}); });
``` ```
### setAVPlaybackState ### setAVPlaybackState<sup>10+</sup>
setAVPlaybackState(state: AVPlaybackState): Promise\<void> setAVPlaybackState(state: AVPlaybackState): Promise\<void>
...@@ -1018,13 +1004,11 @@ Sets information related to the session playback state. This API uses a promise ...@@ -1018,13 +1004,11 @@ Sets information related to the session playback state. This API uses a promise
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ----------------------------------- | ---- | ---------------------------------------------- | | ------ | ----------------------------------- | ---- | ---------------------------------------------- |
| data | [AVPlaybackState](#avplaybackstate) | Yes | Information related to the session playback state.| | data | [AVPlaybackState](#avplaybackstate10) | Yes | Information related to the session playback state.|
**Return value** **Return value**
...@@ -1033,6 +1017,7 @@ Sets information related to the session playback state. This API uses a promise ...@@ -1033,6 +1017,7 @@ Sets information related to the session playback state. This API uses a promise
| Promise\<void> | Promise used to return the result. If the setting is successful, no value is returned; otherwise, an error object is returned.| | Promise\<void> | Promise used to return the result. If the setting is successful, no value is returned; otherwise, an error object is returned.|
**Error codes** **Error codes**
For details about the error codes, see [AVSession Management Error Codes](../errorcodes/errorcode-avsession.md). For details about the error codes, see [AVSession Management Error Codes](../errorcodes/errorcode-avsession.md).
| ID| Error Message| | ID| Error Message|
...@@ -1058,7 +1043,7 @@ session.setAVPlaybackState(playbackState).then(() => { ...@@ -1058,7 +1043,7 @@ session.setAVPlaybackState(playbackState).then(() => {
}); });
``` ```
### setAVPlaybackState ### setAVPlaybackState<sup>10+</sup>
setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback\<void>): void setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback\<void>): void
...@@ -1066,13 +1051,11 @@ Sets information related to the session playback state. This API uses an asynchr ...@@ -1066,13 +1051,11 @@ Sets information related to the session playback state. This API uses an asynchr
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------------- | ---- | ---------------------------------------------- | | -------- | ----------------------------------- | ---- | ---------------------------------------------- |
| data | [AVPlaybackState](#avplaybackstate) | Yes | Information related to the session playback state.| | data | [AVPlaybackState](#avplaybackstate10) | Yes | Information related to the session playback state.|
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the setting is successful, **err** is **undefined**; otherwise, **err** is an error object. | | callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the setting is successful, **err** is **undefined**; otherwise, **err** is an error object. |
**Error codes** **Error codes**
...@@ -1112,8 +1095,6 @@ Sets a playlist. This API uses a promise to return the result. ...@@ -1112,8 +1095,6 @@ Sets a playlist. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -1182,8 +1163,6 @@ Sets a playlist. This API uses an asynchronous callback to return the result. ...@@ -1182,8 +1163,6 @@ Sets a playlist. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -1249,8 +1228,6 @@ Sets a name for the playlist. This API uses a promise to return the result. ...@@ -1249,8 +1228,6 @@ Sets a name for the playlist. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -1291,8 +1268,6 @@ Sets a name for the playlist. This API uses an asynchronous callback to return t ...@@ -1291,8 +1268,6 @@ Sets a name for the playlist. This API uses an asynchronous callback to return t
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -1322,7 +1297,7 @@ session.setAVQueueTitle(queueTitle, function (err) { ...@@ -1322,7 +1297,7 @@ session.setAVQueueTitle(queueTitle, function (err) {
}); });
``` ```
### setLaunchAbility ### setLaunchAbility<sup>10+</sup>
setLaunchAbility(ability: WantAgent): Promise\<void> setLaunchAbility(ability: WantAgent): Promise\<void>
...@@ -1330,8 +1305,6 @@ Sets a launcher ability. This API uses a promise to return the result. ...@@ -1330,8 +1305,6 @@ Sets a launcher ability. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -1395,7 +1368,7 @@ wantAgent.getWantAgent(wantAgentInfo).then((agent) => { ...@@ -1395,7 +1368,7 @@ wantAgent.getWantAgent(wantAgentInfo).then((agent) => {
}); });
``` ```
### setLaunchAbility ### setLaunchAbility<sup>10+</sup>
setLaunchAbility(ability: WantAgent, callback: AsyncCallback\<void>): void setLaunchAbility(ability: WantAgent, callback: AsyncCallback\<void>): void
...@@ -1403,8 +1376,6 @@ Sets a launcher ability. This API uses an asynchronous callback to return the re ...@@ -1403,8 +1376,6 @@ Sets a launcher ability. This API uses an asynchronous callback to return the re
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -1473,8 +1444,6 @@ Dispatches a custom event in the session, including the event name and event con ...@@ -1473,8 +1444,6 @@ Dispatches a custom event in the session, including the event name and event con
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -1521,8 +1490,6 @@ Dispatches a custom event in the session, including the event name and event con ...@@ -1521,8 +1490,6 @@ Dispatches a custom event in the session, including the event name and event con
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -1566,8 +1533,6 @@ Sets a custom media packet in the form of key-value pairs. This API uses a promi ...@@ -1566,8 +1533,6 @@ Sets a custom media packet in the form of key-value pairs. This API uses a promi
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -1645,7 +1610,7 @@ await session.setExtras(extras, (err) => { ...@@ -1645,7 +1610,7 @@ await session.setExtras(extras, (err) => {
}) })
``` ```
### getController ### getController<sup>10+</sup>
getController(): Promise\<AVSessionController> getController(): Promise\<AVSessionController>
...@@ -1653,13 +1618,11 @@ Obtains the controller corresponding to this session. This API uses a promise to ...@@ -1653,13 +1618,11 @@ Obtains the controller corresponding to this session. This API uses a promise to
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------------------- | ----------------------------- | | ---------------------------------------------------- | ----------------------------- |
| Promise<[AVSessionController](#avsessioncontroller)> | Promise used to return the session controller.| | Promise<[AVSessionController](#avsessioncontroller10)> | Promise used to return the session controller.|
**Error codes** **Error codes**
...@@ -1682,7 +1645,7 @@ session.getController().then((avcontroller) => { ...@@ -1682,7 +1645,7 @@ session.getController().then((avcontroller) => {
}); });
``` ```
### getController ### getController<sup>10+</sup>
getController(callback: AsyncCallback\<AVSessionController>): void getController(callback: AsyncCallback\<AVSessionController>): void
...@@ -1690,13 +1653,11 @@ Obtains the controller corresponding to this session. This API uses an asynchron ...@@ -1690,13 +1653,11 @@ Obtains the controller corresponding to this session. This API uses an asynchron
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------------- | ---- | -------------------------- | | -------- | ----------------------------------------------------------- | ---- | -------------------------- |
| callback | AsyncCallback<[AVSessionController](#avsessioncontroller)\> | Yes | Callback used to return the session controller.| | callback | AsyncCallback<[AVSessionController](#avsessioncontroller10)\> | Yes | Callback used to return the session controller.|
**Error codes** **Error codes**
...@@ -1721,7 +1682,7 @@ session.getController(function (err, avcontroller) { ...@@ -1721,7 +1682,7 @@ session.getController(function (err, avcontroller) {
}); });
``` ```
### getOutputDevice ### getOutputDevice<sup>10+</sup>
getOutputDevice(): Promise\<OutputDeviceInfo> getOutputDevice(): Promise\<OutputDeviceInfo>
...@@ -1729,13 +1690,11 @@ Obtains information about the output device for this session. This API uses a pr ...@@ -1729,13 +1690,11 @@ Obtains information about the output device for this session. This API uses a pr
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------------- | --------------------------------- | | ---------------------------------------------- | --------------------------------- |
| Promise<[OutputDeviceInfo](#outputdeviceinfo)> | Promise used to return the output device information.| | Promise<[OutputDeviceInfo](#outputdeviceinfo10)> | Promise used to return the output device information.|
**Error codes** **Error codes**
...@@ -1756,7 +1715,7 @@ session.getOutputDevice().then((outputDeviceInfo) => { ...@@ -1756,7 +1715,7 @@ session.getOutputDevice().then((outputDeviceInfo) => {
}); });
``` ```
### getOutputDevice ### getOutputDevice<sup>10+</sup>
getOutputDevice(callback: AsyncCallback\<OutputDeviceInfo>): void getOutputDevice(callback: AsyncCallback\<OutputDeviceInfo>): void
...@@ -1764,13 +1723,11 @@ Obtains information about the output device for this session. This API uses an a ...@@ -1764,13 +1723,11 @@ Obtains information about the output device for this session. This API uses an a
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------- | ---- | ------------------------------ | | -------- | ----------------------------------------------------- | ---- | ------------------------------ |
| callback | AsyncCallback<[OutputDeviceInfo](#outputdeviceinfo)\> | Yes | Callback used to return the information obtained.| | callback | AsyncCallback<[OutputDeviceInfo](#outputdeviceinfo10)\> | Yes | Callback used to return the information obtained.|
**Error codes** **Error codes**
...@@ -1793,7 +1750,7 @@ session.getOutputDevice(function (err, outputDeviceInfo) { ...@@ -1793,7 +1750,7 @@ session.getOutputDevice(function (err, outputDeviceInfo) {
}); });
``` ```
### activate ### activate<sup>10+</sup>
activate(): Promise\<void> activate(): Promise\<void>
...@@ -1801,8 +1758,6 @@ Activates this session. A session can be used only after being activated. This A ...@@ -1801,8 +1758,6 @@ Activates this session. A session can be used only after being activated. This A
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
...@@ -1828,7 +1783,7 @@ session.activate().then(() => { ...@@ -1828,7 +1783,7 @@ session.activate().then(() => {
}); });
``` ```
### activate ### activate<sup>10+</sup>
activate(callback: AsyncCallback\<void>): void activate(callback: AsyncCallback\<void>): void
...@@ -1836,8 +1791,6 @@ Activates this session. A session can be used only after being activated. This A ...@@ -1836,8 +1791,6 @@ Activates this session. A session can be used only after being activated. This A
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -1865,16 +1818,14 @@ session.activate(function (err) { ...@@ -1865,16 +1818,14 @@ session.activate(function (err) {
}); });
``` ```
### deactivate ### deactivate<sup>10+</sup>
deactivate(): Promise\<void> deactivate(): Promise\<void>
Deactivates this session. You can use [activate](#activate) to activate the session again. This API uses a promise to return the result. Deactivates this session. You can use [activate](#activate10) to activate the session again. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
...@@ -1900,18 +1851,16 @@ session.deactivate().then(() => { ...@@ -1900,18 +1851,16 @@ session.deactivate().then(() => {
}); });
``` ```
### deactivate ### deactivate<sup>10+</sup>
deactivate(callback: AsyncCallback\<void>): void deactivate(callback: AsyncCallback\<void>): void
Deactivates this session. This API uses an asynchronous callback to return the result. Deactivates this session. This API uses an asynchronous callback to return the result.
Deactivates this session. You can use [activate](#activate) to activate the session again. Deactivates this session. You can use [activate](#activate10) to activate the session again.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -1939,7 +1888,7 @@ session.deactivate(function (err) { ...@@ -1939,7 +1888,7 @@ session.deactivate(function (err) {
}); });
``` ```
### destroy ### destroy<sup>10+</sup>
destroy(): Promise\<void> destroy(): Promise\<void>
...@@ -1947,8 +1896,6 @@ Destroys this session. This API uses a promise to return the result. ...@@ -1947,8 +1896,6 @@ Destroys this session. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
...@@ -1974,7 +1921,7 @@ session.destroy().then(() => { ...@@ -1974,7 +1921,7 @@ session.destroy().then(() => {
}); });
``` ```
### destroy ### destroy<sup>10+</sup>
destroy(callback: AsyncCallback\<void>): void destroy(callback: AsyncCallback\<void>): void
...@@ -1982,8 +1929,6 @@ Destroys this session. This API uses an asynchronous callback to return the resu ...@@ -1982,8 +1929,6 @@ Destroys this session. This API uses an asynchronous callback to return the resu
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2011,7 +1956,7 @@ session.destroy(function (err) { ...@@ -2011,7 +1956,7 @@ session.destroy(function (err) {
}); });
``` ```
### on('play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind') ### on('play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind')<sup>10+</sup>
on(type: 'play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind', callback: () => void): void on(type: 'play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind', callback: () => void): void
...@@ -2019,8 +1964,6 @@ Subscribes to playback command events. ...@@ -2019,8 +1964,6 @@ Subscribes to playback command events.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2063,7 +2006,7 @@ session.on('rewind', () => { ...@@ -2063,7 +2006,7 @@ session.on('rewind', () => {
}); });
``` ```
### on('seek') ### on('seek')<sup>10+</sup>
on(type: 'seek', callback: (time: number) => void): void on(type: 'seek', callback: (time: number) => void): void
...@@ -2071,8 +2014,6 @@ Subscribes to the seek event. ...@@ -2071,8 +2014,6 @@ Subscribes to the seek event.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2097,7 +2038,7 @@ session.on('seek', (time) => { ...@@ -2097,7 +2038,7 @@ session.on('seek', (time) => {
}); });
``` ```
### on('setSpeed') ### on('setSpeed')<sup>10+</sup>
on(type: 'setSpeed', callback: (speed: number) => void): void on(type: 'setSpeed', callback: (speed: number) => void): void
...@@ -2105,8 +2046,6 @@ Subscribes to the event for setting the playback speed. ...@@ -2105,8 +2046,6 @@ Subscribes to the event for setting the playback speed.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2131,7 +2070,7 @@ session.on('setSpeed', (speed) => { ...@@ -2131,7 +2070,7 @@ session.on('setSpeed', (speed) => {
}); });
``` ```
### on('setLoopMode') ### on('setLoopMode')<sup>10+</sup>
on(type: 'setLoopMode', callback: (mode: LoopMode) => void): void on(type: 'setLoopMode', callback: (mode: LoopMode) => void): void
...@@ -2139,14 +2078,12 @@ Subscribes to the event for setting the loop mode. ...@@ -2139,14 +2078,12 @@ Subscribes to the event for setting the loop mode.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | ---- | | -------- | ------------------------------------- | ---- | ---- |
| type | string | Yes | Event type. The event **'setLoopMode'** is reported when the command for setting the loop mode is sent to the session.| | type | string | Yes | Event type. The event **'setLoopMode'** is reported when the command for setting the loop mode is sent to the session.|
| callback | (mode: [LoopMode](#loopmode)) => void | Yes | Callback used for subscription. The **mode** parameter in the callback indicates the loop mode. | | callback | (mode: [LoopMode](#loopmode10)) => void | Yes | Callback used for subscription. The **mode** parameter in the callback indicates the loop mode. |
**Error codes** **Error codes**
...@@ -2165,7 +2102,7 @@ session.on('setLoopMode', (mode) => { ...@@ -2165,7 +2102,7 @@ session.on('setLoopMode', (mode) => {
}); });
``` ```
### on('toggleFavorite') ### on('toggleFavorite')<sup>10+</sup>
on(type: 'toggleFavorite', callback: (assetId: string) => void): void on(type: 'toggleFavorite', callback: (assetId: string) => void): void
...@@ -2173,8 +2110,6 @@ Subscribes to the event for favoriting a media asset. ...@@ -2173,8 +2110,6 @@ Subscribes to the event for favoriting a media asset.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2207,8 +2142,6 @@ Subscribes to the event that indicates an item in the playlist is selected. The ...@@ -2207,8 +2142,6 @@ Subscribes to the event that indicates an item in the playlist is selected. The
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2233,7 +2166,7 @@ session.on('skipToQueueItem', (itemId) => { ...@@ -2233,7 +2166,7 @@ session.on('skipToQueueItem', (itemId) => {
}); });
``` ```
### on('handleKeyEvent') ### on('handleKeyEvent')<sup>10+</sup>
on(type: 'handleKeyEvent', callback: (event: KeyEvent) => void): void on(type: 'handleKeyEvent', callback: (event: KeyEvent) => void): void
...@@ -2241,8 +2174,6 @@ Subscribes to the key event. ...@@ -2241,8 +2174,6 @@ Subscribes to the key event.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2267,7 +2198,7 @@ session.on('handleKeyEvent', (event) => { ...@@ -2267,7 +2198,7 @@ session.on('handleKeyEvent', (event) => {
}); });
``` ```
### on('outputDeviceChange') ### on('outputDeviceChange')<sup>10+</sup>
on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): void on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): void
...@@ -2275,14 +2206,12 @@ Subscribes to output device changes. ...@@ -2275,14 +2206,12 @@ Subscribes to output device changes.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The event **'outputDeviceChange'** is reported when the output device changes.| | type | string | Yes | Event type. The event **'outputDeviceChange'** is reported when the output device changes.|
| callback | (device: [OutputDeviceInfo](#outputdeviceinfo)) => void | Yes | Callback used for subscription. The **device** parameter in the callback indicates the output device information. | | callback | (device: [OutputDeviceInfo](#outputdeviceinfo10)) => void | Yes | Callback used for subscription. The **device** parameter in the callback indicates the output device information. |
**Error codes** **Error codes**
...@@ -2309,8 +2238,6 @@ Subscribes to custom control command changes. ...@@ -2309,8 +2238,6 @@ Subscribes to custom control command changes.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2335,7 +2262,7 @@ session.on('commonCommand', (commonCommand, args) => { ...@@ -2335,7 +2262,7 @@ session.on('commonCommand', (commonCommand, args) => {
}); });
``` ```
### off('play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind') ### off('play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind')<sup>10+</sup>
off(type: 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind', callback?: () => void): void off(type: 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind', callback?: () => void): void
...@@ -2343,8 +2270,6 @@ Unsubscribes from playback command events. ...@@ -2343,8 +2270,6 @@ Unsubscribes from playback command events.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2373,7 +2298,7 @@ session.off('fastForward'); ...@@ -2373,7 +2298,7 @@ session.off('fastForward');
session.off('rewind'); session.off('rewind');
``` ```
### off('seek') ### off('seek')<sup>10+</sup>
off(type: 'seek', callback?: (time: number) => void): void off(type: 'seek', callback?: (time: number) => void): void
...@@ -2381,8 +2306,6 @@ Unsubscribes from the seek event. ...@@ -2381,8 +2306,6 @@ Unsubscribes from the seek event.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2405,7 +2328,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -2405,7 +2328,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
session.off('seek'); session.off('seek');
``` ```
### off('setSpeed') ### off('setSpeed')<sup>10+</sup>
off(type: 'setSpeed', callback?: (speed: number) => void): void off(type: 'setSpeed', callback?: (speed: number) => void): void
...@@ -2413,8 +2336,6 @@ Unsubscribes from the event for setting the playback speed. ...@@ -2413,8 +2336,6 @@ Unsubscribes from the event for setting the playback speed.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2437,7 +2358,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -2437,7 +2358,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
session.off('setSpeed'); session.off('setSpeed');
``` ```
### off('setLoopMode') ### off('setLoopMode')<sup>10+</sup>
off(type: 'setLoopMode', callback?: (mode: LoopMode) => void): void off(type: 'setLoopMode', callback?: (mode: LoopMode) => void): void
...@@ -2445,14 +2366,12 @@ Unsubscribes from the event for setting loop mode. ...@@ -2445,14 +2366,12 @@ Unsubscribes from the event for setting loop mode.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | ----- | | -------- | ------------------------------------- | ---- | ----- |
| type | string | Yes | Event type. The value is fixed at **'setLoopMode'**.| | type | string | Yes | Event type. The value is fixed at **'setLoopMode'**.|
| callback | (mode: [LoopMode](#loopmode)) => void | No | Callback used for unsubscription. The **mode** parameter in the callback indicates the loop mode.<br>If the unsubscription is successful, **err** is **undefined**; otherwise, **err** is an error object.<br>The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session.| | callback | (mode: [LoopMode](#loopmode10)) => void | No | Callback used for unsubscription. The **mode** parameter in the callback indicates the loop mode.<br>If the unsubscription is successful, **err** is **undefined**; otherwise, **err** is an error object.<br>The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session.|
**Error codes** **Error codes**
...@@ -2469,7 +2388,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -2469,7 +2388,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
session.off('setLoopMode'); session.off('setLoopMode');
``` ```
### off('toggleFavorite') ### off('toggleFavorite')<sup>10+</sup>
off(type: 'toggleFavorite', callback?: (assetId: string) => void): void off(type: 'toggleFavorite', callback?: (assetId: string) => void): void
...@@ -2477,8 +2396,6 @@ Unsubscribes from the event for favoriting a media asset. ...@@ -2477,8 +2396,6 @@ Unsubscribes from the event for favoriting a media asset.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2509,8 +2426,6 @@ Unsubscribes from the event that indicates an item in the playlist is selected. ...@@ -2509,8 +2426,6 @@ Unsubscribes from the event that indicates an item in the playlist is selected.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2533,7 +2448,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -2533,7 +2448,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
session.off('skipToQueueItem'); session.off('skipToQueueItem');
``` ```
### off('handleKeyEvent') ### off('handleKeyEvent')<sup>10+</sup>
off(type: 'handleKeyEvent', callback?: (event: KeyEvent) => void): void off(type: 'handleKeyEvent', callback?: (event: KeyEvent) => void): void
...@@ -2541,8 +2456,6 @@ Unsubscribes from the key event. ...@@ -2541,8 +2456,6 @@ Unsubscribes from the key event.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2565,7 +2478,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -2565,7 +2478,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
session.off('handleKeyEvent'); session.off('handleKeyEvent');
``` ```
### off('outputDeviceChange') ### off('outputDeviceChange')<sup>10+</sup>
off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void): void off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void): void
...@@ -2573,14 +2486,12 @@ Unsubscribes from playback device changes. ...@@ -2573,14 +2486,12 @@ Unsubscribes from playback device changes.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------ | | -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed at **'outputDeviceChange'**. | | type | string | Yes | Event type. The value is fixed at **'outputDeviceChange'**. |
| callback | (device: [OutputDeviceInfo](#outputdeviceinfo)) => void | No | Callback used for unsubscription. The **device** parameter in the callback indicates the output device information.<br>If the unsubscription is successful, **err** is **undefined**; otherwise, **err** is an error object.<br>The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. | | callback | (device: [OutputDeviceInfo](#outputdeviceinfo10)) => void | No | Callback used for unsubscription. The **device** parameter in the callback indicates the output device information.<br>If the unsubscription is successful, **err** is **undefined**; otherwise, **err** is an error object.<br>The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
**Error codes** **Error codes**
...@@ -2606,8 +2517,6 @@ Unsubscribes from custom control command changes. ...@@ -2606,8 +2517,6 @@ Unsubscribes from custom control command changes.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2631,7 +2540,7 @@ session.off('commonCommand'); ...@@ -2631,7 +2540,7 @@ session.off('commonCommand');
## AVSessionController ## AVSessionController<sup>10+</sup>
An AV session controller is created by calling [avSession.createController](#avsessioncreatecontroller). Through the AV session controller, you can query the session ID, send commands and events to a session, and obtain session metadata and playback state information. An AV session controller is created by calling [avSession.createController](#avsessioncreatecontroller). Through the AV session controller, you can query the session ID, send commands and events to a session, and obtain session metadata and playback state information.
...@@ -2639,9 +2548,6 @@ An AV session controller is created by calling [avSession.createController](#avs ...@@ -2639,9 +2548,6 @@ An AV session controller is created by calling [avSession.createController](#avs
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
| :-------- | :----- | :--- | :--- | :-------------------------------------- | | :-------- | :----- | :--- | :--- | :-------------------------------------- |
| sessionId | string | Yes | No | Unique session ID of the **AVSessionController** object.| | sessionId | string | Yes | No | Unique session ID of the **AVSessionController** object.|
...@@ -2657,7 +2563,7 @@ await avSession.createController(session.sessionId).then((controller) => { ...@@ -2657,7 +2563,7 @@ await avSession.createController(session.sessionId).then((controller) => {
}); });
``` ```
### getAVPlaybackState ### getAVPlaybackState<sup>10+</sup>
getAVPlaybackState(): Promise\<AVPlaybackState> getAVPlaybackState(): Promise\<AVPlaybackState>
...@@ -2665,13 +2571,11 @@ Obtains the information related to the playback state. This API uses a promise t ...@@ -2665,13 +2571,11 @@ Obtains the information related to the playback state. This API uses a promise t
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------------------------------- | --------------------------- | | --------------------------------------------- | --------------------------- |
| Promise<[AVPlaybackState](#avplaybackstate)\> | Promise used to return the **AVPlaybackState** object.| | Promise<[AVPlaybackState](#avplaybackstate10)\> | Promise used to return the **AVPlaybackState** object.|
**Error codes** **Error codes**
...@@ -2692,7 +2596,7 @@ controller.getAVPlaybackState().then((playbackState) => { ...@@ -2692,7 +2596,7 @@ controller.getAVPlaybackState().then((playbackState) => {
}); });
``` ```
### getAVPlaybackState ### getAVPlaybackState<sup>10+</sup>
getAVPlaybackState(callback: AsyncCallback\<AVPlaybackState>): void getAVPlaybackState(callback: AsyncCallback\<AVPlaybackState>): void
...@@ -2700,13 +2604,11 @@ Obtains the information related to the playback state. This API uses an asynchro ...@@ -2700,13 +2604,11 @@ Obtains the information related to the playback state. This API uses an asynchro
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------- | ---- | ---------------------------- | | -------- | --------------------------------------------------- | ---- | ---------------------------- |
| callback | AsyncCallback<[AVPlaybackState](#avplaybackstate)\> | Yes | Callback used to return the **AVPlaybackState** object.| | callback | AsyncCallback<[AVPlaybackState](#avplaybackstate10)\> | Yes | Callback used to return the **AVPlaybackState** object.|
**Error codes** **Error codes**
...@@ -2737,8 +2639,6 @@ Obtains the information related to the items in the queue. This API uses a promi ...@@ -2737,8 +2639,6 @@ Obtains the information related to the items in the queue. This API uses a promi
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
...@@ -2772,8 +2672,6 @@ Obtains the information related to the items in the playlist. This API uses an a ...@@ -2772,8 +2672,6 @@ Obtains the information related to the items in the playlist. This API uses an a
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2809,8 +2707,6 @@ Obtains the name of the playlist. This API uses a promise to return the result. ...@@ -2809,8 +2707,6 @@ Obtains the name of the playlist. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
...@@ -2844,8 +2740,6 @@ Obtains the name of the playlist. This API uses an asynchronous callback to retu ...@@ -2844,8 +2740,6 @@ Obtains the name of the playlist. This API uses an asynchronous callback to retu
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2881,8 +2775,6 @@ Sends the ID of an item in the playlist to the session for processing. The sessi ...@@ -2881,8 +2775,6 @@ Sends the ID of an item in the playlist to the session for processing. The sessi
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2923,8 +2815,6 @@ Sends the ID of an item in the playlist to the session for processing. The sessi ...@@ -2923,8 +2815,6 @@ Sends the ID of an item in the playlist to the session for processing. The sessi
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -2954,7 +2844,7 @@ controller.skipToQueueItem(queueItemId, function (err) { ...@@ -2954,7 +2844,7 @@ controller.skipToQueueItem(queueItemId, function (err) {
}); });
``` ```
### getAVMetadata ### getAVMetadata<sup>10+</sup>
getAVMetadata(): Promise\<AVMetadata> getAVMetadata(): Promise\<AVMetadata>
...@@ -2962,13 +2852,11 @@ Obtains the session metadata. This API uses a promise to return the result. ...@@ -2962,13 +2852,11 @@ Obtains the session metadata. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
| ----------------------------------- | ----------------------------- | | ----------------------------------- | ----------------------------- |
| Promise<[AVMetadata](#avmetadata)\> | Promise used to return the metadata obtained.| | Promise<[AVMetadata](#avmetadata10)\> | Promise used to return the metadata obtained.|
**Error codes** **Error codes**
...@@ -2989,7 +2877,7 @@ controller.getAVMetadata().then((metadata) => { ...@@ -2989,7 +2877,7 @@ controller.getAVMetadata().then((metadata) => {
}); });
``` ```
### getAVMetadata ### getAVMetadata<sup>10+</sup>
getAVMetadata(callback: AsyncCallback\<AVMetadata>): void getAVMetadata(callback: AsyncCallback\<AVMetadata>): void
...@@ -2997,13 +2885,11 @@ Obtains the session metadata. This API uses an asynchronous callback to return t ...@@ -2997,13 +2885,11 @@ Obtains the session metadata. This API uses an asynchronous callback to return t
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------------------- | ---- | -------------------------- | | -------- | ----------------------------------------- | ---- | -------------------------- |
| callback | AsyncCallback<[AVMetadata](#avmetadata)\> | Yes | Callback used to return the metadata obtained.| | callback | AsyncCallback<[AVMetadata](#avmetadata10)\> | Yes | Callback used to return the metadata obtained.|
**Error codes** **Error codes**
...@@ -3026,7 +2912,7 @@ controller.getAVMetadata(function (err, metadata) { ...@@ -3026,7 +2912,7 @@ controller.getAVMetadata(function (err, metadata) {
}); });
``` ```
### getOutputDevice ### getOutputDevice<sup>10+</sup>
getOutputDevice(): Promise\<OutputDeviceInfo> getOutputDevice(): Promise\<OutputDeviceInfo>
...@@ -3034,13 +2920,11 @@ Obtains the output device information. This API uses a promise to return the res ...@@ -3034,13 +2920,11 @@ Obtains the output device information. This API uses a promise to return the res
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
| ----------------------------------------------- | --------------------------------- | | ----------------------------------------------- | --------------------------------- |
| Promise<[OutputDeviceInfo](#outputdeviceinfo)\> | Promise used to return the information obtained.| | Promise<[OutputDeviceInfo](#outputdeviceinfo10)\> | Promise used to return the information obtained.|
**Error codes** **Error codes**
...@@ -3060,7 +2944,7 @@ controller.getOutputDevice().then((deviceInfo) => { ...@@ -3060,7 +2944,7 @@ controller.getOutputDevice().then((deviceInfo) => {
}); });
``` ```
### getOutputDevice ### getOutputDevice<sup>10+</sup>
getOutputDevice(callback: AsyncCallback\<OutputDeviceInfo>): void getOutputDevice(callback: AsyncCallback\<OutputDeviceInfo>): void
...@@ -3068,13 +2952,11 @@ Obtains the output device information. This API uses an asynchronous callback to ...@@ -3068,13 +2952,11 @@ Obtains the output device information. This API uses an asynchronous callback to
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------- | ---- | ------------------------------ | | -------- | ----------------------------------------------------- | ---- | ------------------------------ |
| callback | AsyncCallback<[OutputDeviceInfo](#outputdeviceinfo)\> | Yes | Callback used to return the information obtained.| | callback | AsyncCallback<[OutputDeviceInfo](#outputdeviceinfo10)\> | Yes | Callback used to return the information obtained.|
**Error codes** **Error codes**
...@@ -3105,8 +2987,6 @@ Obtains the custom media packet set by the provider. This API uses a promise to ...@@ -3105,8 +2987,6 @@ Obtains the custom media packet set by the provider. This API uses a promise to
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
...@@ -3138,8 +3018,6 @@ Obtains the custom media packet set by the provider. This API uses an asynchrono ...@@ -3138,8 +3018,6 @@ Obtains the custom media packet set by the provider. This API uses an asynchrono
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -3183,7 +3061,7 @@ controller.getExtras(function (err, extras) { ...@@ -3183,7 +3061,7 @@ controller.getExtras(function (err, extras) {
}); });
``` ```
### sendAVKeyEvent ### sendAVKeyEvent<sup>10+</sup>
sendAVKeyEvent(event: KeyEvent): Promise\<void> sendAVKeyEvent(event: KeyEvent): Promise\<void>
...@@ -3191,8 +3069,6 @@ Sends a key event to the session corresponding to this controller. This API uses ...@@ -3191,8 +3069,6 @@ Sends a key event to the session corresponding to this controller. This API uses
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
...@@ -3230,7 +3106,7 @@ controller.sendAVKeyEvent(event).then(() => { ...@@ -3230,7 +3106,7 @@ controller.sendAVKeyEvent(event).then(() => {
}); });
``` ```
### sendAVKeyEvent ### sendAVKeyEvent<sup>10+</sup>
sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback\<void>): void sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback\<void>): void
...@@ -3238,8 +3114,6 @@ Sends a key event to the session corresponding to this controller. This API uses ...@@ -3238,8 +3114,6 @@ Sends a key event to the session corresponding to this controller. This API uses
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -3274,7 +3148,7 @@ controller.sendAVKeyEvent(event, function (err) { ...@@ -3274,7 +3148,7 @@ controller.sendAVKeyEvent(event, function (err) {
}); });
``` ```
### getLaunchAbility ### getLaunchAbility<sup>10+</sup>
getLaunchAbility(): Promise\<WantAgent> getLaunchAbility(): Promise\<WantAgent>
...@@ -3282,13 +3156,11 @@ Obtains the **WantAgent** object saved by the application in the session. This A ...@@ -3282,13 +3156,11 @@ Obtains the **WantAgent** object saved by the application in the session. This A
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------------------------------------------- | ------------------------------------------------------------ | | ------------------------------------------------------- | ------------------------------------------------------------ |
| Promise<[WantAgent](js-apis-app-ability-wantAgent.md)\> | Promise used to return the object saved by calling [setLaunchAbility](#setlaunchability). The object includes the application attribute, such as the bundle name, ability name, and device ID.| | Promise<[WantAgent](js-apis-app-ability-wantAgent.md)\> | Promise used to return the object saved by calling [setLaunchAbility](#setlaunchability10). The object includes the application attribute, such as the bundle name, ability name, and device ID.|
**Error codes** **Error codes**
...@@ -3312,7 +3184,7 @@ controller.getLaunchAbility().then((agent) => { ...@@ -3312,7 +3184,7 @@ controller.getLaunchAbility().then((agent) => {
}); });
``` ```
### getLaunchAbility ### getLaunchAbility<sup>10+</sup>
getLaunchAbility(callback: AsyncCallback\<WantAgent>): void getLaunchAbility(callback: AsyncCallback\<WantAgent>): void
...@@ -3320,13 +3192,11 @@ Obtains the **WantAgent** object saved by the application in the session. This A ...@@ -3320,13 +3192,11 @@ Obtains the **WantAgent** object saved by the application in the session. This A
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| callback | AsyncCallback<[WantAgent](js-apis-app-ability-wantAgent.md)\> | Yes | Callback used to return the object saved by calling [setLaunchAbility](#setlaunchability). The object includes the application attribute, such as the bundle name, ability name, and device ID.| | callback | AsyncCallback<[WantAgent](js-apis-app-ability-wantAgent.md)\> | Yes | Callback used to return the object saved by calling [setLaunchAbility](#setlaunchability10). The object includes the application attribute, such as the bundle name, ability name, and device ID.|
**Error codes** **Error codes**
...@@ -3352,7 +3222,7 @@ controller.getLaunchAbility(function (err, agent) { ...@@ -3352,7 +3222,7 @@ controller.getLaunchAbility(function (err, agent) {
}); });
``` ```
### getRealPlaybackPositionSync ### getRealPlaybackPositionSync<sup>10+</sup>
getRealPlaybackPositionSync(): number getRealPlaybackPositionSync(): number
...@@ -3360,8 +3230,6 @@ Obtains the playback position. ...@@ -3360,8 +3230,6 @@ Obtains the playback position.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
...@@ -3383,7 +3251,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -3383,7 +3251,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
let time = controller.getRealPlaybackPositionSync(); let time = controller.getRealPlaybackPositionSync();
``` ```
### isActive ### isActive<sup>10+</sup>
isActive(): Promise\<boolean> isActive(): Promise\<boolean>
...@@ -3391,8 +3259,6 @@ Checks whether the session is activated. This API uses a promise to return the r ...@@ -3391,8 +3259,6 @@ Checks whether the session is activated. This API uses a promise to return the r
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
...@@ -3419,7 +3285,7 @@ controller.isActive().then((isActive) => { ...@@ -3419,7 +3285,7 @@ controller.isActive().then((isActive) => {
}); });
``` ```
### isActive ### isActive<sup>10+</sup>
isActive(callback: AsyncCallback\<boolean>): void isActive(callback: AsyncCallback\<boolean>): void
...@@ -3427,8 +3293,6 @@ Checks whether the session is activated. This API uses an asynchronous callback ...@@ -3427,8 +3293,6 @@ Checks whether the session is activated. This API uses an asynchronous callback
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -3457,7 +3321,7 @@ controller.isActive(function (err, isActive) { ...@@ -3457,7 +3321,7 @@ controller.isActive(function (err, isActive) {
}); });
``` ```
### destroy ### destroy<sup>10+</sup>
destroy(): Promise\<void> destroy(): Promise\<void>
...@@ -3465,8 +3329,6 @@ Destroys this controller. A controller can no longer be used after being destroy ...@@ -3465,8 +3329,6 @@ Destroys this controller. A controller can no longer be used after being destroy
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
...@@ -3492,7 +3354,7 @@ controller.destroy().then(() => { ...@@ -3492,7 +3354,7 @@ controller.destroy().then(() => {
}); });
``` ```
### destroy ### destroy<sup>10+</sup>
destroy(callback: AsyncCallback\<void>): void destroy(callback: AsyncCallback\<void>): void
...@@ -3500,8 +3362,6 @@ Destroys this controller. A controller can no longer be used after being destroy ...@@ -3500,8 +3362,6 @@ Destroys this controller. A controller can no longer be used after being destroy
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -3529,7 +3389,7 @@ controller.destroy(function (err) { ...@@ -3529,7 +3389,7 @@ controller.destroy(function (err) {
}); });
``` ```
### getValidCommands ### getValidCommands<sup>10+</sup>
getValidCommands(): Promise\<Array\<AVControlCommandType>> getValidCommands(): Promise\<Array\<AVControlCommandType>>
...@@ -3537,13 +3397,11 @@ Obtains valid commands supported by the session. This API uses a promise to retu ...@@ -3537,13 +3397,11 @@ Obtains valid commands supported by the session. This API uses a promise to retu
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------------------------------------------------ | --------------------------------- | | ------------------------------------------------------------ | --------------------------------- |
| Promise<Array<[AVControlCommandType](#avcontrolcommandtype)\>\> | Promise used to return a set of valid commands.| | Promise<Array<[AVControlCommandType](#avcontrolcommandtype10)\>\> | Promise used to return a set of valid commands.|
**Error codes** **Error codes**
...@@ -3565,7 +3423,7 @@ controller.getValidCommands.then((validCommands) => { ...@@ -3565,7 +3423,7 @@ controller.getValidCommands.then((validCommands) => {
}); });
``` ```
### getValidCommands ### getValidCommands<sup>10+</sup>
getValidCommands(callback: AsyncCallback\<Array\<AVControlCommandType>>): void getValidCommands(callback: AsyncCallback\<Array\<AVControlCommandType>>): void
...@@ -3573,13 +3431,11 @@ Obtains valid commands supported by the session. This API uses an asynchronous c ...@@ -3573,13 +3431,11 @@ Obtains valid commands supported by the session. This API uses an asynchronous c
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------ |
| callback | AsyncCallback\<Array\<[AVControlCommandType](#avcontrolcommandtype)\>\> | Yes | Callback used to return a set of valid commands.| | callback | AsyncCallback\<Array\<[AVControlCommandType](#avcontrolcommandtype10)\>\> | Yes | Callback used to return a set of valid commands.|
**Error codes** **Error codes**
...@@ -3603,7 +3459,7 @@ controller.getValidCommands(function (err, validCommands) { ...@@ -3603,7 +3459,7 @@ controller.getValidCommands(function (err, validCommands) {
}); });
``` ```
### sendControlCommand ### sendControlCommand<sup>10+</sup>
sendControlCommand(command: AVControlCommand): Promise\<void> sendControlCommand(command: AVControlCommand): Promise\<void>
...@@ -3611,17 +3467,15 @@ Sends a control command to the session through the controller. This API uses a p ...@@ -3611,17 +3467,15 @@ Sends a control command to the session through the controller. This API uses a p
> **NOTE** > **NOTE**
> >
> Before using **sendControlCommand**, the controller must ensure that the AVSession has registered with the corresponding listener. For details about how to register the listener, see [Registering AVSession Listeners](#onplaypausestopplaynextplaypreviousfastforwardrewind). > Before using **sendControlCommand**, the controller must ensure that the AVSession has registered with the corresponding listener. For details about how to register the listener, see [Registering AVSession Listeners](#onplaypausestopplaynextplaypreviousfastforwardrewind10).
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ------------------------------------- | ---- | ------------------------------ | | ------- | ------------------------------------- | ---- | ------------------------------ |
| command | [AVControlCommand](#avcontrolcommand) | Yes | Command to send.| | command | [AVControlCommand](#avcontrolcommand10) | Yes | Command to send.|
**Return value** **Return value**
...@@ -3663,7 +3517,7 @@ controller.sendControlCommand(avCommand).then(() => { ...@@ -3663,7 +3517,7 @@ controller.sendControlCommand(avCommand).then(() => {
}); });
``` ```
### sendControlCommand ### sendControlCommand<sup>10+</sup>
sendControlCommand(command: AVControlCommand, callback: AsyncCallback\<void>): void sendControlCommand(command: AVControlCommand, callback: AsyncCallback\<void>): void
...@@ -3671,17 +3525,15 @@ Sends a control command to the session through the controller. This API uses an ...@@ -3671,17 +3525,15 @@ Sends a control command to the session through the controller. This API uses an
> **NOTE** > **NOTE**
> >
> Before using **sendControlCommand**, the controller must ensure that the AVSession has registered with the corresponding listener. For details about how to register the listener, see [Registering AVSession Listeners](#onplaypausestopplaynextplaypreviousfastforwardrewind). > Before using **sendControlCommand**, the controller must ensure that the AVSession has registered with the corresponding listener. For details about how to register the listener, see [Registering AVSession Listeners](#onplaypausestopplaynextplaypreviousfastforwardrewind10).
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | ------------------------------ | | -------- | ------------------------------------- | ---- | ------------------------------ |
| command | [AVControlCommand](#avcontrolcommand) | Yes | Command to send.| | command | [AVControlCommand](#avcontrolcommand10) | Yes | Command to send.|
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the command is sent, **err** is **undefined**; otherwise, **err** is an error object. | | callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the command is sent, **err** is **undefined**; otherwise, **err** is an error object. |
**Error codes** **Error codes**
...@@ -3728,8 +3580,6 @@ Sends a custom control command to the session through the controller. This API u ...@@ -3728,8 +3580,6 @@ Sends a custom control command to the session through the controller. This API u
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -3780,8 +3630,6 @@ Sends a custom control command to the session through the controller. This API u ...@@ -3780,8 +3630,6 @@ Sends a custom control command to the session through the controller. This API u
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -3795,6 +3643,7 @@ Sends a custom control command to the session through the controller. This API u ...@@ -3795,6 +3643,7 @@ Sends a custom control command to the session through the controller. This API u
> The **args** parameter supports the following data types: string, number, Boolean, object, array, and file descriptor. For details, see [@ohos.app.ability.Want(Want)](./js-apis-app-ability-want.md). > The **args** parameter supports the following data types: string, number, Boolean, object, array, and file descriptor. For details, see [@ohos.app.ability.Want(Want)](./js-apis-app-ability-want.md).
**Error codes** **Error codes**
For details about the error codes, see [AVSession Management Error Codes](../errorcodes/errorcode-avsession.md). For details about the error codes, see [AVSession Management Error Codes](../errorcodes/errorcode-avsession.md).
| ID| Error Message| | ID| Error Message|
...@@ -3820,7 +3669,7 @@ controller.sendCommonCommand(commandName, args, (err) => { ...@@ -3820,7 +3669,7 @@ controller.sendCommonCommand(commandName, args, (err) => {
}) })
``` ```
### on('metadataChange') ### on('metadataChange')<sup>10+</sup>
on(type: 'metadataChange', filter: Array\<keyof AVMetadata> | 'all', callback: (data: AVMetadata) => void) on(type: 'metadataChange', filter: Array\<keyof AVMetadata> | 'all', callback: (data: AVMetadata) => void)
...@@ -3828,15 +3677,13 @@ Subscribes to the metadata change event. ...@@ -3828,15 +3677,13 @@ Subscribes to the metadata change event.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The event **'metadataChange'** is reported when the session metadata changes.| | type | string | Yes | Event type. The event **'metadataChange'** is reported when the session metadata changes.|
| filter | Array\<keyof&nbsp;[AVMetadata](#avmetadata)\>&nbsp;&#124;&nbsp;'all' | Yes | The value **'all'** indicates that any metadata field change will trigger the event, and **Array<keyof [AVMetadata](#avmetadata)\>** indicates that only changes to the listed metadata field will trigger the event.| | filter | Array\<keyof&nbsp;[AVMetadata](#avmetadata10)\>&nbsp;&#124;&nbsp;'all' | Yes | The value **'all'** indicates that any metadata field change will trigger the event, and **Array<keyof&nbsp;[AVMetadata](#avmetadata10)\>** indicates that only changes to the listed metadata field will trigger the event.|
| callback | (data: [AVMetadata](#avmetadata)) => void | Yes | Callback used for subscription. The **data** parameter in the callback indicates the changed metadata. | | callback | (data: [AVMetadata](#avmetadata10)) => void | Yes | Callback used for subscription. The **data** parameter in the callback indicates the changed metadata. |
**Error codes** **Error codes**
...@@ -3860,7 +3707,7 @@ controller.on('metadataChange', metaFilter, (metadata) => { ...@@ -3860,7 +3707,7 @@ controller.on('metadataChange', metaFilter, (metadata) => {
}); });
``` ```
### on('playbackStateChange') ### on('playbackStateChange')<sup>10+</sup>
on(type: 'playbackStateChange', filter: Array\<keyof AVPlaybackState> | 'all', callback: (state: AVPlaybackState) => void) on(type: 'playbackStateChange', filter: Array\<keyof AVPlaybackState> | 'all', callback: (state: AVPlaybackState) => void)
...@@ -3868,15 +3715,13 @@ Subscribes to the playback state change event. ...@@ -3868,15 +3715,13 @@ Subscribes to the playback state change event.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The event **'playbackStateChange'** is reported when the playback state changes.| | type | string | Yes | Event type. The event **'playbackStateChange'** is reported when the playback state changes.|
| filter | Array\<keyof&nbsp;[AVPlaybackState](#avplaybackstate)\>&nbsp;&#124;&nbsp;'all' | Yes | The value **'all'** indicates that any playback state field change will trigger the event, and **Array<keyof [AVPlaybackState](#avplaybackstate)\>** indicates that only changes to the listed playback state field will trigger the event.| | filter | Array\<keyof&nbsp;[AVPlaybackState](#avplaybackstate10)\>&nbsp;&#124;&nbsp;'all' | Yes | The value **'all'** indicates that any playback state field change will trigger the event, and **Array<keyof&nbsp;[AVPlaybackState](#avplaybackstate10)\>** indicates that only changes to the listed playback state field will trigger the event.|
| callback | (state: [AVPlaybackState](#avplaybackstate)) => void | Yes | Callback used for subscription. The **state** parameter in the callback indicates the changed playback state. | | callback | (state: [AVPlaybackState](#avplaybackstate10)) => void | Yes | Callback used for subscription. The **state** parameter in the callback indicates the changed playback state. |
**Error codes** **Error codes**
...@@ -3908,8 +3753,6 @@ Subscribes to session event changes. This API is called by the controller. ...@@ -3908,8 +3753,6 @@ Subscribes to session event changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -3942,8 +3785,6 @@ Subscribes to playlist item changes. This API is called by the controller. ...@@ -3942,8 +3785,6 @@ Subscribes to playlist item changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -3976,8 +3817,6 @@ Subscribes to playlist name changes. This API is called by the controller. ...@@ -3976,8 +3817,6 @@ Subscribes to playlist name changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -4010,8 +3849,6 @@ Subscribes to custom media packet changes. This API is called by the controller. ...@@ -4010,8 +3849,6 @@ Subscribes to custom media packet changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -4037,7 +3874,7 @@ controller.on('extrasChange', (extras) => { ...@@ -4037,7 +3874,7 @@ controller.on('extrasChange', (extras) => {
}); });
``` ```
### on('sessionDestroy') ### on('sessionDestroy')<sup>10+</sup>
on(type: 'sessionDestroy', callback: () => void) on(type: 'sessionDestroy', callback: () => void)
...@@ -4045,8 +3882,6 @@ Subscribes to the session destruction event. ...@@ -4045,8 +3882,6 @@ Subscribes to the session destruction event.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -4071,7 +3906,7 @@ controller.on('sessionDestroy', () => { ...@@ -4071,7 +3906,7 @@ controller.on('sessionDestroy', () => {
}); });
``` ```
### on('activeStateChange') ### on('activeStateChange')<sup>10+</sup>
on(type: 'activeStateChange', callback: (isActive: boolean) => void) on(type: 'activeStateChange', callback: (isActive: boolean) => void)
...@@ -4079,8 +3914,6 @@ Subscribes to the session activation state change event. ...@@ -4079,8 +3914,6 @@ Subscribes to the session activation state change event.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -4105,7 +3938,7 @@ controller.on('activeStateChange', (isActive) => { ...@@ -4105,7 +3938,7 @@ controller.on('activeStateChange', (isActive) => {
}); });
``` ```
### on('validCommandChange') ### on('validCommandChange')<sup>10+</sup>
on(type: 'validCommandChange', callback: (commands: Array\<AVControlCommandType>) => void) on(type: 'validCommandChange', callback: (commands: Array\<AVControlCommandType>) => void)
...@@ -4113,14 +3946,12 @@ Subscribes to valid command changes. ...@@ -4113,14 +3946,12 @@ Subscribes to valid command changes.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The event **'validCommandChange'** is reported when the valid commands supported by the session changes.| | type | string | Yes | Event type. The event **'validCommandChange'** is reported when the valid commands supported by the session changes.|
| callback | (commands: Array<[AVControlCommandType](#avcontrolcommandtype)\>) => void | Yes | Callback used for subscription. The **commands** parameter in the callback is a set of valid commands. | | callback | (commands: Array<[AVControlCommandType](#avcontrolcommandtype10)\>) => void | Yes | Callback used for subscription. The **commands** parameter in the callback is a set of valid commands. |
**Error codes** **Error codes**
...@@ -4140,7 +3971,7 @@ controller.on('validCommandChange', (validCommands) => { ...@@ -4140,7 +3971,7 @@ controller.on('validCommandChange', (validCommands) => {
}); });
``` ```
### on('outputDeviceChange') ### on('outputDeviceChange')<sup>10+</sup>
on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): void on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): void
...@@ -4148,14 +3979,12 @@ Subscribes to output device changes. ...@@ -4148,14 +3979,12 @@ Subscribes to output device changes.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The event **'outputDeviceChange'** is reported when the output device changes.| | type | string | Yes | Event type. The event **'outputDeviceChange'** is reported when the output device changes.|
| callback | (device: [OutputDeviceInfo](#outputdeviceinfo)) => void | Yes | Callback used for subscription. The **device** parameter in the callback indicates the output device information. | | callback | (device: [OutputDeviceInfo](#outputdeviceinfo10)) => void | Yes | Callback used for subscription. The **device** parameter in the callback indicates the output device information. |
**Error codes** **Error codes**
...@@ -4174,7 +4003,7 @@ controller.on('outputDeviceChange', (device) => { ...@@ -4174,7 +4003,7 @@ controller.on('outputDeviceChange', (device) => {
}); });
``` ```
### off('metadataChange') ### off('metadataChange')<sup>10+</sup>
off(type: 'metadataChange', callback?: (data: AVMetadata) => void) off(type: 'metadataChange', callback?: (data: AVMetadata) => void)
...@@ -4182,14 +4011,12 @@ Unsubscribes from metadata changes. This API is called by the controller. ...@@ -4182,14 +4011,12 @@ Unsubscribes from metadata changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------ | ---- | ------------------------------------------------------ | | -------- | ------------------------------------------------ | ---- | ------------------------------------------------------ |
| type | string | Yes | Event type. The event **'metadataChange'** is reported when the session metadata changes. | | type | string | Yes | Event type. The event **'metadataChange'** is reported when the session metadata changes. |
| callback | (data: [AVMetadata](#avmetadata)) => void | No | Callback used for subscription. The **data** parameter in the callback indicates the changed metadata.<br>The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. | | callback | (data: [AVMetadata](#avmetadata10)) => void | No | Callback used for subscription. The **data** parameter in the callback indicates the changed metadata.<br>The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
**Error codes** **Error codes**
...@@ -4205,7 +4032,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -4205,7 +4032,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
controller.off('metadataChange'); controller.off('metadataChange');
``` ```
### off('playbackStateChange') ### off('playbackStateChange')<sup>10+</sup>
off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void) off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void)
...@@ -4213,14 +4040,12 @@ Unsubscribes from playback state changes. This API is called by the controller. ...@@ -4213,14 +4040,12 @@ Unsubscribes from playback state changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------- | | -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------- |
| type | string | Yes | Event type. The event **'playbackStateChange'** is reported when the playback state changes. | | type | string | Yes | Event type. The event **'playbackStateChange'** is reported when the playback state changes. |
| callback | (state: [AVPlaybackState](#avplaybackstate)) => void | No | Callback used for subscription. The **state** parameter in the callback indicates the changed playback state.<br>The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. | | callback | (state: [AVPlaybackState](#avplaybackstate10)) => void | No | Callback used for subscription. The **state** parameter in the callback indicates the changed playback state.<br>The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
**Error codes** **Error codes**
...@@ -4244,8 +4069,6 @@ Unsubscribes from session event changes. This API is called by the controller. ...@@ -4244,8 +4069,6 @@ Unsubscribes from session event changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -4275,8 +4098,6 @@ Unsubscribes from playback item changes. This API is called by the controller. ...@@ -4275,8 +4098,6 @@ Unsubscribes from playback item changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -4306,8 +4127,6 @@ Unsubscribes from playlist name changes. This API is called by the controller. ...@@ -4306,8 +4127,6 @@ Unsubscribes from playlist name changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -4337,8 +4156,6 @@ Unsubscribes from custom media packet changes. This API is called by the control ...@@ -4337,8 +4156,6 @@ Unsubscribes from custom media packet changes. This API is called by the control
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -4362,7 +4179,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -4362,7 +4179,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
controller.off('extrasChange'); controller.off('extrasChange');
``` ```
### off('sessionDestroy') ### off('sessionDestroy')<sup>10+</sup>
off(type: 'sessionDestroy', callback?: () => void) off(type: 'sessionDestroy', callback?: () => void)
...@@ -4370,8 +4187,6 @@ Unsubscribes from the session destruction event. This API is called by the contr ...@@ -4370,8 +4187,6 @@ Unsubscribes from the session destruction event. This API is called by the contr
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -4393,7 +4208,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -4393,7 +4208,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
controller.off('sessionDestroy'); controller.off('sessionDestroy');
``` ```
### off('activeStateChange') ### off('activeStateChange')<sup>10+</sup>
off(type: 'activeStateChange', callback?: (isActive: boolean) => void) off(type: 'activeStateChange', callback?: (isActive: boolean) => void)
...@@ -4401,8 +4216,6 @@ Unsubscribes from session activation state changes. This API is called by the co ...@@ -4401,8 +4216,6 @@ Unsubscribes from session activation state changes. This API is called by the co
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -4424,7 +4237,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -4424,7 +4237,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
controller.off('activeStateChange'); controller.off('activeStateChange');
``` ```
### off('validCommandChange') ### off('validCommandChange')<sup>10+</sup>
off(type: 'validCommandChange', callback?: (commands: Array\<AVControlCommandType>) => void) off(type: 'validCommandChange', callback?: (commands: Array\<AVControlCommandType>) => void)
...@@ -4432,14 +4245,12 @@ Unsubscribes from valid command changes. This API is called by the controller. ...@@ -4432,14 +4245,12 @@ Unsubscribes from valid command changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | -------------------------------------------------------- | | -------- | ------------------------------------------------------------ | ---- | -------------------------------------------------------- |
| type | string | Yes | Event type. The event **'validCommandChange'** is reported when the supported commands change. | | type | string | Yes | Event type. The event **'validCommandChange'** is reported when the supported commands change. |
| callback | (commands: Array<[AVControlCommandType](#avcontrolcommandtype)\>) => void | No | Callback used for unsubscription. The **commands** parameter in the callback is a set of valid commands.<br>The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. | | callback | (commands: Array<[AVControlCommandType](#avcontrolcommandtype10)\>) => void | No | Callback used for unsubscription. The **commands** parameter in the callback is a set of valid commands.<br>The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
**Error codes** **Error codes**
...@@ -4455,7 +4266,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -4455,7 +4266,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
controller.off('validCommandChange'); controller.off('validCommandChange');
``` ```
### off('outputDeviceChange') ### off('outputDeviceChange')<sup>10+</sup>
off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void): void off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void): void
...@@ -4463,14 +4274,12 @@ Unsubscribes from output device changes. This API is called by the controller. ...@@ -4463,14 +4274,12 @@ Unsubscribes from output device changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------ | | -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------ |
| type | string | Yes | Event type. The event **'outputDeviceChange'** is reported when the output device changes. | | type | string | Yes | Event type. The event **'outputDeviceChange'** is reported when the output device changes. |
| callback | (device: [OutputDeviceInfo](#outputdeviceinfo)) => void | No | Callback used for unsubscription. The **device** parameter in the callback indicates the output device information.<br>The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. | | callback | (device: [OutputDeviceInfo](#outputdeviceinfo10)) => void | No | Callback used for unsubscription. The **device** parameter in the callback indicates the output device information.<br>The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
**Error codes** **Error codes**
...@@ -4502,13 +4311,11 @@ Describes the information about a session token. ...@@ -4502,13 +4311,11 @@ Describes the information about a session token.
| pid | number | Yes | Process ID of the session.| | pid | number | Yes | Process ID of the session.|
| uid | number | Yes | User ID. | | uid | number | Yes | User ID. |
## AVSessionType ## AVSessionType<sup>10+<sup>
Enumerates the session types supported by the session. Enumerates the session types supported by the session.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
| Name | Type | Description| | Name | Type | Description|
| ----- | ------ | ---- | | ----- | ------ | ---- |
| audio | string | Audio session.| | audio | string | Audio session.|
...@@ -4525,21 +4332,19 @@ Declares the session descriptor. ...@@ -4525,21 +4332,19 @@ Declares the session descriptor.
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
| ------------ | ------------------------------------------------------------ | ---- | --------------------------------------------------- | --------------------------------------------------- | | ------------ | ------------------------------------------------------------ | ---- | --------------------------------------------------- | --------------------------------------------------- |
| sessionId | string | Yes | No| Session ID. | | sessionId | string | Yes | No| Session ID. |
| type | [AVSessionType](#avsessiontype) | Yes | No | Session type. | | type | [AVSessionType](#avsessiontype10) | Yes | No | Session type. |
| sessionTag | string | Yes | No | Custom session name. | | sessionTag | string | Yes | No | Custom session name. |
| elementName | [ElementName](js-apis-bundle-ElementName.md) | Yes | No | Information about the application to which the session belongs, including the bundle name and ability name.| | elementName | [ElementName](js-apis-bundle-ElementName.md) | Yes | No | Information about the application to which the session belongs, including the bundle name and ability name.|
| isActive | boolean | Yes | No | Whether the session is activated. | | isActive | boolean | Yes | No | Whether the session is activated. |
| isTopSession | boolean | Yes | No | Whether the session is the top session. | | isTopSession | boolean | Yes | No | Whether the session is the top session. |
| outputDevice | [OutputDeviceInfo](#outputdeviceinfo) | Yes | No | Information about the output device. | | outputDevice | [OutputDeviceInfo](#outputdeviceinfo10) | Yes | No | Information about the output device. |
## AVControlCommandType ## AVControlCommandType<sup>10+</sup>
Enumerates the commands that can be sent to a session. Enumerates the commands that can be sent to a session.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
| Name | Type | Description | | Name | Type | Description |
| -------------- | ------ | ------------ | | -------------- | ------ | ------------ |
| play | string | Play the media. | | play | string | Play the media. |
...@@ -4554,27 +4359,23 @@ Enumerates the commands that can be sent to a session. ...@@ -4554,27 +4359,23 @@ Enumerates the commands that can be sent to a session.
| setLoopMode | string | Set the loop mode.| | setLoopMode | string | Set the loop mode.|
| toggleFavorite | string | Favorite the media asset. | | toggleFavorite | string | Favorite the media asset. |
## AVControlCommand ## AVControlCommand<sup>10+</sup>
Describes the command that can be sent to the session. Describes the command that can be sent to the session.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------- | ------------------------------------------------- | ---- | -------------- | | --------- | ------------------------------------------------- | ---- | -------------- |
| command | [AVControlCommandType](#avcontrolcommandtype) | Yes | Command. | | command | [AVControlCommandType](#avcontrolcommandtype10) | Yes | Command. |
| parameter | [LoopMode](#loopmode) &#124; string &#124; number | No | Parameters carried in the command.| | parameter | [LoopMode](#loopmode10) &#124; string &#124; number | No | Parameters carried in the command.|
## AVMetadata ## AVMetadata<sup>10+</sup>
Describes the media metadata. Describes the media metadata.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------------- |-------------------------| ---- |---------------------------------------------------------------------| | --------------- |-------------------------| ---- |---------------------------------------------------------------------|
| assetId | string | Yes | Media ID. | | assetId | string | Yes | Media ID. |
...@@ -4621,60 +4422,52 @@ Describes the attributes of an item in the playlist. ...@@ -4621,60 +4422,52 @@ Describes the attributes of an item in the playlist.
| itemId | number | Yes | ID of an item in the playlist. | | itemId | number | Yes | ID of an item in the playlist. |
| description | [AVMediaDescription](#avmediadescription10) | Yes | Media metadata of the item in the playlist. | | description | [AVMediaDescription](#avmediadescription10) | Yes | Media metadata of the item in the playlist. |
## AVPlaybackState ## AVPlaybackState<sup>10+</sup>
Describes the information related to the media playback state. Describes the information related to the media playback state.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------------ | ------------------------------------- | ---- | ------- | | ------------ | ------------------------------------- | ---- | ------- |
| state | [PlaybackState](#playbackstate) | No | Playback state.| | state | [PlaybackState](#playbackstate) | No | Playback state.|
| speed | number | No | Playback speed.| | speed | number | No | Playback speed.|
| position | [PlaybackPosition](#playbackposition) | No | Playback position.| | position | [PlaybackPosition](#playbackposition) | No | Playback position.|
| bufferedTime | number | No | Buffered time.| | bufferedTime | number | No | Buffered time.|
| loopMode | [LoopMode](#loopmode) | No | Loop mode.| | loopMode | [LoopMode](#loopmode10) | No | Loop mode.|
| isFavorite | boolean | No | Whether the media asset is favorited.| | isFavorite | boolean | No | Whether the media asset is favorited.|
| activeItemId<sup>10+</sup> | number | No | ID of the item that is being played.| | activeItemId<sup>10+</sup> | number | No | ID of the item that is being played.|
| extras<sup>10+</sup> | {[key: string]: Object} | No | Custom media data.| | extras<sup>10+</sup> | {[key: string]: Object} | No | Custom media data.|
## PlaybackPosition ## PlaybackPosition<sup>10+</sup>
Describes the information related to the playback position. Describes the information related to the playback position.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ------------------ | | ----------- | ------ | ---- | ------------------ |
| elapsedTime | number | Yes | Elapsed time, in ms.| | elapsedTime | number | Yes | Elapsed time, in ms.|
| updateTime | number | Yes | Updated time, in ms.| | updateTime | number | Yes | Updated time, in ms.|
## OutputDeviceInfo ## OutputDeviceInfo<sup>10+</sup>
Describes the information related to the output device. Describes the information related to the output device.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | -------------- | ---- | ---------------------- | | ---------- | -------------- | ---- | ---------------------- |
| isRemote | boolean | Yes | Whether the device is connected. | | isRemote | boolean | Yes | Whether the device is connected. |
| audioDeviceId | Array<number\> | Yes | IDs of output devices. | | audioDeviceId | Array<number\> | Yes | IDs of output devices. |
| deviceName | Array<string\> | Yes | Names of output devices. | | deviceName | Array<string\> | Yes | Names of output devices. |
## PlaybackState ## PlaybackState<sup>10+</sup>
Enumerates the media playback states. Enumerates the media playback states.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
| Name | Value | Description | | Name | Value | Description |
| --------------------------- | ---- | ----------- | | --------------------------- | ---- | ----------- |
| PLAYBACK_STATE_INITIAL | 0 | Initial. | | PLAYBACK_STATE_INITIAL | 0 | Initial. |
...@@ -4686,14 +4479,12 @@ Enumerates the media playback states. ...@@ -4686,14 +4479,12 @@ Enumerates the media playback states.
| PLAYBACK_STATE_STOP | 6 | Stopped. | | PLAYBACK_STATE_STOP | 6 | Stopped. |
## LoopMode ## LoopMode<sup>10+</sup>
Enumerates the loop modes of media playback. Enumerates the loop modes of media playback.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
| Name | Value | Description | | Name | Value | Description |
| ------------------ | ---- | -------- | | ------------------ | ---- | -------- |
| LOOP_MODE_SEQUENCE | 0 | Sequential playback.| | LOOP_MODE_SEQUENCE | 0 | Sequential playback.|
...@@ -4701,14 +4492,12 @@ Enumerates the loop modes of media playback. ...@@ -4701,14 +4492,12 @@ Enumerates the loop modes of media playback.
| LOOP_MODE_LIST | 2 | Playlist loop.| | LOOP_MODE_LIST | 2 | Playlist loop.|
| LOOP_MODE_SHUFFLE | 3 | Shuffle.| | LOOP_MODE_SHUFFLE | 3 | Shuffle.|
## AVSessionErrorCode ## AVSessionErrorCode<sup>10+</sup>
Enumerates the error codes used in the media session. Enumerates the error codes used in the media session.
**System capability**: SystemCapability.Multimedia.AVSession.Core **System capability**: SystemCapability.Multimedia.AVSession.Core
**System API**: This is a system API.
| Name | Value | Description | | Name | Value | Description |
| ------------------------------ | ------- | ------------------------------- | | ------------------------------ | ------- | ------------------------------- |
| ERR_CODE_SERVICE_EXCEPTION | 6600101 | Session service exception. | | ERR_CODE_SERVICE_EXCEPTION | 6600101 | Session service exception. |
...@@ -4719,4 +4508,4 @@ Enumerates the error codes used in the media session. ...@@ -4719,4 +4508,4 @@ Enumerates the error codes used in the media session.
| ERR_CODE_SESSION_INACTIVE | 6600106 | The session is not activated. | | ERR_CODE_SESSION_INACTIVE | 6600106 | The session is not activated. |
| ERR_CODE_MESSAGE_OVERLOAD | 6600107 | Too many commands or events. | | ERR_CODE_MESSAGE_OVERLOAD | 6600107 | Too many commands or events. |
<!--no_check--> <!--no_check-->
\ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
- [HAR](quick-start/har-package.md) - [HAR](quick-start/har-package.md)
- HSP - HSP
- [In-Application HSP Development](quick-start/in-app-hsp.md) - [In-Application HSP Development](quick-start/in-app-hsp.md)
- [Inter-Application HSP Development (for System Applications Only)](quick-start/cross-app-hsp.md) - [Inter-Application HSP Development](quick-start/cross-app-hsp.md)
- Quick Fix - Quick Fix
- [Quick Fix Overview](quick-start/quickfix-principles.md) - [Quick Fix Overview](quick-start/quickfix-principles.md)
- [CLI-based Quick Fix Development](quick-start/quickfix-debug.md) - [CLI-based Quick Fix Development](quick-start/quickfix-debug.md)
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
- [AccessibilityExtensionAbility](application-models/accessibilityextensionability.md) - [AccessibilityExtensionAbility](application-models/accessibilityextensionability.md)
- [EnterpriseAdminExtensionAbility](application-models/enterprise-extensionAbility.md) - [EnterpriseAdminExtensionAbility](application-models/enterprise-extensionAbility.md)
- [InputMethodExtensionAbility](application-models/inputmethodextentionability.md) - [InputMethodExtensionAbility](application-models/inputmethodextentionability.md)
- [WindowExtensionAbility](application-models/windowextensionability.md) - [WindowExtensionAbility (for System Applications Only)](application-models/windowextensionability.md)
- Service Widget Development in Stage Model - Service Widget Development in Stage Model
- [Service Widget Overview](application-models/service-widget-overview.md) - [Service Widget Overview](application-models/service-widget-overview.md)
- Developing an ArkTS Widget - Developing an ArkTS Widget
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
- [Subscribing to Common Events in Static Mode (for System Applications Only)](application-models/common-event-static-subscription.md) - [Subscribing to Common Events in Static Mode (for System Applications Only)](application-models/common-event-static-subscription.md)
- [Unsubscribing from Common Events](application-models/common-event-unsubscription.md) - [Unsubscribing from Common Events](application-models/common-event-unsubscription.md)
- [Publishing Common Events](application-models/common-event-publish.md) - [Publishing Common Events](application-models/common-event-publish.md)
- [Removing Sticky Common Events](application-models/common-event-remove-sticky.md) - [Removing Sticky Common Events (for System Applications Only)](application-models/common-event-remove-sticky.md)
- [Background Services](application-models/background-services.md) - [Background Services](application-models/background-services.md)
- Thread Model - Thread Model
- [Thread Model Overview](application-models/thread-model-stage.md) - [Thread Model Overview](application-models/thread-model-stage.md)
...@@ -434,7 +434,7 @@ ...@@ -434,7 +434,7 @@
- [Developing Audio Call](media/audio-call-development.md) - [Developing Audio Call](media/audio-call-development.md)
- [Video Playback](media/video-playback.md) - [Video Playback](media/video-playback.md)
- [Video Recording](media/video-recording.md) - [Video Recording](media/video-recording.md)
- AVSession (for System Applications Only) - AVSession
- [AVSession Overview](media/avsession-overview.md) - [AVSession Overview](media/avsession-overview.md)
- Local AVSession - Local AVSession
- [Local AVSession Overview](media/local-avsession-overview.md) - [Local AVSession Overview](media/local-avsession-overview.md)
...@@ -443,7 +443,7 @@ ...@@ -443,7 +443,7 @@
- Distributed AVSession - Distributed AVSession
- [Distributed AVSession Overview](media/distributed-avsession-overview.md) - [Distributed AVSession Overview](media/distributed-avsession-overview.md)
- [Using Distributed AVSession](media/using-distributed-avsession.md) - [Using Distributed AVSession](media/using-distributed-avsession.md)
- Camera (for System Applications Only) - Camera
- [Camera Overview](media/camera-overview.md) - [Camera Overview](media/camera-overview.md)
- Camera Development - Camera Development
- [Camera Development Preparations](media/camera-preparation.md) - [Camera Development Preparations](media/camera-preparation.md)
...@@ -542,8 +542,8 @@ ...@@ -542,8 +542,8 @@
- Selecting and Saving User Files (FilePicker) - Selecting and Saving User Files (FilePicker)
- [Selecting User Files](file-management/select-user-file.md) - [Selecting User Files](file-management/select-user-file.md)
- [Saving User Files](file-management/save-user-file.md) - [Saving User Files](file-management/save-user-file.md)
- [Developing a FileManager Application (Available Only for System Applications)](file-management/dev-user-file-manager.md) - [Developing a FileManager Application (for System Applications Only)](file-management/dev-user-file-manager.md)
- [Managing External Storage Devices (Available Only for System Applications)](file-management/manage-external-storage.md) - [Managing External Storage Devices (for System Applications Only)](file-management/manage-external-storage.md)
- Distributed File System - Distributed File System
- [Distributed File System Overview](file-management/distributed-fs-overview.md) - [Distributed File System Overview](file-management/distributed-fs-overview.md)
- [Setting the Security Level of a Distributed File](file-management/set-security-label.md) - [Setting the Security Level of a Distributed File](file-management/set-security-label.md)
...@@ -603,7 +603,6 @@ ...@@ -603,7 +603,6 @@
- [wukong User Guide](application-test/wukong-guidelines.md) - [wukong User Guide](application-test/wukong-guidelines.md)
- [OpenHarmony IDL Specifications and User Guide](IDL/idl-guidelines.md) - [OpenHarmony IDL Specifications and User Guide](IDL/idl-guidelines.md)
- Native APIs - Native APIs
- [Introduction to Native APIs](napi/introduction.md)
- [Using Native APIs in Application Projects](napi/napi-guidelines.md) - [Using Native APIs in Application Projects](napi/napi-guidelines.md)
- [Drawing Development](napi/drawing-guidelines.md) - [Drawing Development](napi/drawing-guidelines.md)
- [Raw File Development](napi/rawfile-guidelines.md) - [Raw File Development](napi/rawfile-guidelines.md)
...@@ -669,12 +668,8 @@ ...@@ -669,12 +668,8 @@
- [Touch Target](reference/arkui-ts/ts-universal-attributes-touch-target.md) - [Touch Target](reference/arkui-ts/ts-universal-attributes-touch-target.md)
- [Polymorphic Style](reference/arkui-ts/ts-universal-attributes-polymorphic-style.md) - [Polymorphic Style](reference/arkui-ts/ts-universal-attributes-polymorphic-style.md)
- [Hit Test Control](reference/arkui-ts/ts-universal-attributes-hit-test-behavior.md) - [Hit Test Control](reference/arkui-ts/ts-universal-attributes-hit-test-behavior.md)
- [Background Blur](reference/arkui-ts/ts-universal-attributes-backgroundBlurStyle.md)
- [restoreId](reference/arkui-ts/ts-universal-attributes-restoreId.md) - [restoreId](reference/arkui-ts/ts-universal-attributes-restoreId.md)
- [Foreground Color](reference/arkui-ts/ts-universal-attributes-foreground-color.md) - [Foreground Color](reference/arkui-ts/ts-universal-attributes-foreground-color.md)
- [Spherical Effect](reference/arkui-ts/ts-universal-attributes-sphericalEffect.md)
- [Light Up Effect](reference/arkui-ts/ts-universal-attributes-lightUpEffect.md)
- [Pixel Stretch Effect](reference/arkui-ts/ts-universal-attributes-pixelStretchEffect.md)
- [Text Style](reference/arkui-ts/ts-universal-attributes-text-style.md) - [Text Style](reference/arkui-ts/ts-universal-attributes-text-style.md)
- Gesture Processing - Gesture Processing
- [Gesture Binding Methods](reference/arkui-ts/ts-gesture-settings.md) - [Gesture Binding Methods](reference/arkui-ts/ts-gesture-settings.md)
...@@ -780,7 +775,6 @@ ...@@ -780,7 +775,6 @@
- [ImageData](reference/arkui-ts/ts-components-canvas-imagedata.md) - [ImageData](reference/arkui-ts/ts-components-canvas-imagedata.md)
- [OffscreenCanvasRenderingConxt2D](reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md) - [OffscreenCanvasRenderingConxt2D](reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md)
- [Path2D](reference/arkui-ts/ts-components-canvas-path2d.md) - [Path2D](reference/arkui-ts/ts-components-canvas-path2d.md)
- [Lottie](reference/arkui-ts/ts-components-canvas-lottie.md)
- Animation - Animation
- [AnimatorProperty](reference/arkui-ts/ts-animatorproperty.md) - [AnimatorProperty](reference/arkui-ts/ts-animatorproperty.md)
- [Explicit Animation](reference/arkui-ts/ts-explicit-animation.md) - [Explicit Animation](reference/arkui-ts/ts-explicit-animation.md)
...@@ -1123,9 +1117,12 @@ ...@@ -1123,9 +1117,12 @@
- [NotificationTemplate](reference/apis/js-apis-inner-notification-notificationTemplate.md) - [NotificationTemplate](reference/apis/js-apis-inner-notification-notificationTemplate.md)
- [NotificationUserInput](reference/apis/js-apis-inner-notification-notificationUserInput.md) - [NotificationUserInput](reference/apis/js-apis-inner-notification-notificationUserInput.md)
- Common Events - Common Events
- [Common Events of the Ability Subsystem](reference/apis/common_event/commonEvent-ability.md)
- [Common Events of the Bundle Management Subsystem](reference/apis/common_event/commonEvent-bundleManager.md) - [Common Events of the Bundle Management Subsystem](reference/apis/common_event/commonEvent-bundleManager.md)
- [Common Events of the Notification Service](reference/apis/common_event/commonEvent-ans.md) - [Common Events of the Notification Service](reference/apis/common_event/commonEvent-ans.md)
- [Common Events of the Resource Scheduler Subsystem](reference/apis/common_event/commonEvent-resourceschedule.md)
- [Common Events of the Telephony Subsystem](reference/apis/common_event/commonEvent-telephony.md) - [Common Events of the Telephony Subsystem](reference/apis/common_event/commonEvent-telephony.md)
- [Common Events of the USB Subsystem](reference/apis/common_event/commonEvent-usb.md)
- Bundle Management - Bundle Management
- [@ohos.bundle.appControl(appControl)](reference/apis/js-apis-appControl.md) - [@ohos.bundle.appControl(appControl)](reference/apis/js-apis-appControl.md)
- [@ohos.bundle.bundleManager (bundleManager)](reference/apis/js-apis-bundleManager.md) - [@ohos.bundle.bundleManager (bundleManager)](reference/apis/js-apis-bundleManager.md)
...@@ -1212,6 +1209,7 @@ ...@@ -1212,6 +1209,7 @@
- security - security
- [PermissionRequestResult](reference/apis/js-apis-permissionrequestresult.md) - [PermissionRequestResult](reference/apis/js-apis-permissionrequestresult.md)
- Data Management - Data Management
- [@ohos.data.cloudData (Device-Cloud Synergy)](reference/apis/js-apis-data-cloudData.md)
- [@ohos.data.dataAbility (DataAbility Predicates)](reference/apis/js-apis-data-ability.md) - [@ohos.data.dataAbility (DataAbility Predicates)](reference/apis/js-apis-data-ability.md)
- [@ohos.data.dataShare (DataShare)](reference/apis/js-apis-data-dataShare.md) - [@ohos.data.dataShare (DataShare)](reference/apis/js-apis-data-dataShare.md)
- [@ohos.data.dataSharePredicates (DataShare Predicates)](reference/apis/js-apis-data-dataSharePredicates.md) - [@ohos.data.dataSharePredicates (DataShare Predicates)](reference/apis/js-apis-data-dataSharePredicates.md)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册