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

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

Merge pull request !19448 from wusongqing/TR18965
......@@ -15,8 +15,8 @@
- Selecting and Saving User Files (FilePicker)
- [Selecting User Files](select-user-file.md)
- [Saving User Files](save-user-file.md)
- [Developing a FileManager Application (Available Only for System Applications)](dev-user-file-manager.md)
- [Managing External Storage Devices (Available Only for System Applications)](manage-external-storage.md)
- [Developing a FileManager Application (for System Applications Only)](dev-user-file-manager.md)
- [Managing External Storage Devices (for System Applications Only)](manage-external-storage.md)
- Distributed File System
- [Distributed File System Overview](distributed-fs-overview.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.
......
# 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.
......@@ -28,13 +28,13 @@ The following table describes the broadcast related parameters.
**Table 1** Broadcast parameters
| Broadcast| Parameter|
| Broadcast| Parameter|
| -------- | -------- |
| usual.event.data.VOLUME_REMOVED | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.|
| usual.event.data.VOLUME_UNMOUNTED | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.<br>**volumeState**: state of the volume.|
| usual.event.data.VOLUME_MOUNTED | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.<br>**volumeState**: state of the volume.<br>**fsUuid**: universally unique identifier (UUID) of the volume.<br>**path**: path where the volume is mounted.|
| usual.event.data.VOLUME_BAD_REMOVAL | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.|
| usual.event.data.VOLUME_EJECT | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.<br>**volumeState**: state of the volume.|
| usual.event.data.VOLUME_REMOVED | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.|
| usual.event.data.VOLUME_UNMOUNTED | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.<br>**volumeState**: state of the volume.|
| usual.event.data.VOLUME_MOUNTED | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.<br>**volumeState**: state of the volume.<br>**fsUuid**: universally unique identifier (UUID) of the volume.<br>**path**: path where the volume is mounted.|
| usual.event.data.VOLUME_BAD_REMOVAL | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.|
| usual.event.data.VOLUME_EJECT | **id**: ID of the volume.<br>**diskId**: ID of the disk to which the volume belongs.<br>**volumeState**: state of the volume.|
## How to Develop
......
......@@ -28,7 +28,7 @@
- [Developing Audio Call](audio-call-development.md)
- [Video Playback](video-playback.md)
- [Video Recording](video-recording.md)
- AVSession (for System Applications Only)
- AVSession
- [AVSession Overview](avsession-overview.md)
- Local AVSession
- [Local AVSession Overview](local-avsession-overview.md)
......@@ -37,7 +37,7 @@
- Distributed AVSession
- [Distributed AVSession Overview](distributed-avsession-overview.md)
- [Using Distributed AVSession](using-distributed-avsession.md)
- Camera (for System Applications Only)
- Camera
- [Camera Overview](camera-overview.md)
- Camera Development
- [Camera Development Preparations](camera-preparation.md)
......
......@@ -26,11 +26,7 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md).
| -------- | -------- |
| getAllSessionDescriptors(callback: AsyncCallback&lt;Array&lt;Readonly&lt;AVSessionDescriptor&gt;&gt;&gt;): void | Obtains the descriptors of all AVSessions in the system.|
| createController(sessionId: string, callback: AsyncCallback&lt;AVSessionController&gt;): 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.|
| 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.|
| 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).
| API| Description|
| -------- | -------- |
| getAVPlaybackState(callback: AsyncCallback&lt;AVPlaybackState&gt;): void | Obtains the information related to the playback state.|
| getAVMetadata(callback: AsyncCallback&lt;AVMetadata&gt;): void | Obtains the session metadata.|
| getOutputDevice(callback: AsyncCallback&lt;OutputDeviceInfo&gt;): void | 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.|
| getLaunchAbility(callback: AsyncCallback&lt;WantAgent&gt;): void | Obtains the **WantAgent** object saved by the application in the session.|
| isActive(callback: AsyncCallback&lt;boolean&gt;): void | 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.|
| getValidCommands(callback: AsyncCallback&lt;Array&lt;AVControlCommandType&gt;&gt;): void | 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.|
| 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<sup>10+<sup> | Obtains the session metadata.|
| getOutputDevice(callback: AsyncCallback&lt;OutputDeviceInfo&gt;): void<sup>10+<sup> | Obtains the output device information.|
| 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<sup>10+<sup> | Obtains the **WantAgent** object saved by the application in the session.|
| isActive(callback: AsyncCallback&lt;boolean&gt;): void<sup>10+<sup> | Checks whether the session is activated.|
| 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<sup>10+<sup> | Obtains valid commands supported by the session.|
| 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.|
| 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.|
......
......@@ -16,15 +16,15 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md).
| 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.|
| setAVMetadata(data: AVMetadata, callback: AsyncCallback&lt;void&gt;): void | Sets AVSession metadata.|
| setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback&lt;void&gt;): void | Sets the AVSession playback state.|
| setLaunchAbility(ability: WantAgent, callback: AsyncCallback&lt;void&gt;): void | Starts a UIAbility.|
| getController(callback: AsyncCallback&lt;AVSessionController&gt;): void | Obtains the controller of the AVSession.|
| getOutputDevice(callback: AsyncCallback&lt;OutputDeviceInfo&gt;): void | Obtains the output device information.|
| activate(callback: AsyncCallback&lt;void&gt;): void | Activates the AVSession.|
| deactivate(callback: AsyncCallback&lt;void&gt;): void | Deactivates this session.|
| destroy(callback: AsyncCallback&lt;void&gt;): void | Destroys the AVSession.|
| 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<sup>10+<sup> | Sets AVSession metadata.|
| 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<sup>10+<sup> | Starts a UIAbility.|
| getController(callback: AsyncCallback&lt;AVSessionController&gt;): void<sup>10+<sup> | Obtains the controller of the AVSession.|
| getOutputDevice(callback: AsyncCallback&lt;OutputDeviceInfo&gt;): void<sup>10+<sup> | Obtains the output device information.|
| activate(callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Activates the AVSession.|
| deactivate(callback: AsyncCallback&lt;void&gt;): void<sup>10+<sup> | Deactivates this session.|
| 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.|
| 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.|
......@@ -343,21 +343,20 @@ To enable an audio and video application to access the AVSession service as a pr
session.off('commonCommand');
}
```
The code snippet below is used for destroying the AVSession object:
```ts
```ts
async destroySession() {
// It is assumed that an AVSession object has been created. For details about how to create an AVSession object, see the node snippet in step 1.
let session: AVSessionManager.AVSession = ALREADY_CREATE_A_SESSION;
// Destroy the AVSession object.
session.destroy(function (err) {
if (err) {
console.error(`Failed to destroy session. Code: ${err.code}, message: ${err.message}`);
} else {
console.info(`Destroy : SUCCESS `);
}
});
// It is assumed that an AVSession object has been created. For details about how to create an AVSession object, see the node snippet in step 1.
let session: AVSessionManager.AVSession = ALREADY_CREATE_A_SESSION;
// Destroy the AVSession object.
session.destroy(function (err) {
if (err) {
console.error(`Failed to destroy session. Code: ${err.code}, message: ${err.message}`);
} else {
console.info(`Destroy : SUCCESS `);
}
});
}
```
\ No newline at end of file
```
......@@ -24,7 +24,7 @@
- [HAR](har-package.md)
- HSP
- [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 Development](atomicService.md)
- [Atomic Service Space Management (for System Applications Only)](atomicService-aging.md)
......
......@@ -3,6 +3,7 @@
- [Common Events of the Ability Subsystem](commonEvent-ability.md)
- [Common Events of the Bundle Management Subsystem](commonEvent-bundleManager.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 USB Subsystem](commonEvent-usb.md)
# Common Events of the Resource Scheduling 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.
# Common Events of the Resource Scheduler Subsystem
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
Indicates that the system idle mode has changed.
......
......@@ -26,7 +26,7 @@
- [HAR](quick-start/har-package.md)
- HSP
- [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 Overview](quick-start/quickfix-principles.md)
- [CLI-based Quick Fix Development](quick-start/quickfix-debug.md)
......@@ -98,7 +98,7 @@
- [AccessibilityExtensionAbility](application-models/accessibilityextensionability.md)
- [EnterpriseAdminExtensionAbility](application-models/enterprise-extensionAbility.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 Overview](application-models/service-widget-overview.md)
- Developing an ArkTS Widget
......@@ -150,7 +150,7 @@
- [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)
- [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)
- Thread Model
- [Thread Model Overview](application-models/thread-model-stage.md)
......@@ -434,7 +434,7 @@
- [Developing Audio Call](media/audio-call-development.md)
- [Video Playback](media/video-playback.md)
- [Video Recording](media/video-recording.md)
- AVSession (for System Applications Only)
- AVSession
- [AVSession Overview](media/avsession-overview.md)
- Local AVSession
- [Local AVSession Overview](media/local-avsession-overview.md)
......@@ -443,7 +443,7 @@
- Distributed AVSession
- [Distributed AVSession Overview](media/distributed-avsession-overview.md)
- [Using Distributed AVSession](media/using-distributed-avsession.md)
- Camera (for System Applications Only)
- Camera
- [Camera Overview](media/camera-overview.md)
- Camera Development
- [Camera Development Preparations](media/camera-preparation.md)
......@@ -542,8 +542,8 @@
- Selecting and Saving User Files (FilePicker)
- [Selecting User Files](file-management/select-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)
- [Managing External Storage Devices (Available Only for System Applications)](file-management/manage-external-storage.md)
- [Developing a FileManager Application (for System Applications Only)](file-management/dev-user-file-manager.md)
- [Managing External Storage Devices (for System Applications Only)](file-management/manage-external-storage.md)
- Distributed File System
- [Distributed File System Overview](file-management/distributed-fs-overview.md)
- [Setting the Security Level of a Distributed File](file-management/set-security-label.md)
......@@ -603,7 +603,6 @@
- [wukong User Guide](application-test/wukong-guidelines.md)
- [OpenHarmony IDL Specifications and User Guide](IDL/idl-guidelines.md)
- Native APIs
- [Introduction to Native APIs](napi/introduction.md)
- [Using Native APIs in Application Projects](napi/napi-guidelines.md)
- [Drawing Development](napi/drawing-guidelines.md)
- [Raw File Development](napi/rawfile-guidelines.md)
......@@ -669,12 +668,8 @@
- [Touch Target](reference/arkui-ts/ts-universal-attributes-touch-target.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)
- [Background Blur](reference/arkui-ts/ts-universal-attributes-backgroundBlurStyle.md)
- [restoreId](reference/arkui-ts/ts-universal-attributes-restoreId.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)
- Gesture Processing
- [Gesture Binding Methods](reference/arkui-ts/ts-gesture-settings.md)
......@@ -780,7 +775,6 @@
- [ImageData](reference/arkui-ts/ts-components-canvas-imagedata.md)
- [OffscreenCanvasRenderingConxt2D](reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md)
- [Path2D](reference/arkui-ts/ts-components-canvas-path2d.md)
- [Lottie](reference/arkui-ts/ts-components-canvas-lottie.md)
- Animation
- [AnimatorProperty](reference/arkui-ts/ts-animatorproperty.md)
- [Explicit Animation](reference/arkui-ts/ts-explicit-animation.md)
......@@ -1123,9 +1117,12 @@
- [NotificationTemplate](reference/apis/js-apis-inner-notification-notificationTemplate.md)
- [NotificationUserInput](reference/apis/js-apis-inner-notification-notificationUserInput.md)
- 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 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 USB Subsystem](reference/apis/common_event/commonEvent-usb.md)
- Bundle Management
- [@ohos.bundle.appControl(appControl)](reference/apis/js-apis-appControl.md)
- [@ohos.bundle.bundleManager (bundleManager)](reference/apis/js-apis-bundleManager.md)
......@@ -1212,6 +1209,7 @@
- security
- [PermissionRequestResult](reference/apis/js-apis-permissionrequestresult.md)
- 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.dataShare (DataShare)](reference/apis/js-apis-data-dataShare.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.
先完成此消息的编辑!
想要评论请 注册