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

!22501 翻译完成:21825+22199 播控UIExtensionAbility文档增加+相机错误码补充

Merge pull request !22501 from wusongqing/TR21825
# Setting Atomic Services to Support Sharing
## How to Develop
1. An application calls [UIAbility.onShare()](../reference/apis/js-apis-app-ability-uiAbility.md#onshare), a lifecycle callback provided by the UIAbility component, to set the data to share. In this lifecycle callback, **ohos.extra.param.key.contentTitle** indicates the title of the content to share in the sharing box, **ohos.extra.param.key.shareAbstract** provides an abstract description of the content, and **ohos.extra.param.key.shareUrl** indicates the online address of the service. You need to set these three items as objects, with the key set to **title**, **abstract**, and **url**, respectively.
```ts
import AbilityConstant from '@ohos.app.ability.AbilityConstant';
class MyUIAbility extends UIAbility {
onShare(wantParams) {
console.log('onShare');
wantParams['ohos.extra.param.key.contentTitle'] = 'shareFeatureAbility';
wantParams['ohos.extra.param.key.shareAbstract'] = 'huawei employee';
wantParams['ohos.extra.param.key.shareUrl'] = 'w3.huawei.com';
}
}
```
2. A system dialog box calls [abilityManager.acquireShareData()](../reference/apis/js-apis-app-ability-abilityManager.md#acquiresharedata) to obtain data shared through atomic service sharing. Specifically, the system finds the UIAbility based on the mission ID and calls the **OnShare()** lifecycle of the UIAbility to obtain the shared data.
```ts
import abilityManager from '@ohos.app.ability.abilityManager';
try {
abilityManager.acquireShareData(1, (err, wantParam) => {
if (err) {
console.error(`acquireShareData fail, err: ${JSON.stringify(err)}`);
} else {
console.log(`acquireShareData success, data: ${JSON.stringify(wantParam)}`);
}
});
} catch (paramError) {
console.error(`error.code: ${JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)}`);
}
```
......@@ -16,6 +16,8 @@
- [@ohos.app.ability.ServiceExtensionAbility (ServiceExtensionAbility)](js-apis-app-ability-serviceExtensionAbility.md)
- [@ohos.app.ability.StartOptions (StartOptions)](js-apis-app-ability-startOptions.md)
- [@ohos.app.ability.UIAbility (UIAbility)](js-apis-app-ability-uiAbility.md)
- [@ohos.app.ability.UIExtensionAbility (Base Class for ExtensionAbilities with UI)](js-apis-app-ability-uiExtensionAbility.md)
- [@ohos.app.ability.UIExtensionContentSession (UI Operation Class for ExtensionAbilities with UI)](js-apis-app-ability-uiExtensionContentSession.md)
- [@ohos.app.form.FormExtensionAbility (FormExtensionAbility)](js-apis-app-form-formExtensionAbility.md)
- [@ohos.application.DataShareExtensionAbility (DataShareExtensionAbility)](js-apis-application-dataShareExtensionAbility.md)
- [@ohos.application.StaticSubscriberExtensionAbility (StaticSubscriberExtensionAbility)](js-apis-application-staticSubscriberExtensionAbility.md)
......@@ -106,6 +108,7 @@
- [ProcessInformation](js-apis-inner-application-processInformation.md)
- [ServiceExtensionContext](js-apis-inner-application-serviceExtensionContext.md)
- [UIAbilityContext](js-apis-inner-application-uiAbilityContext.md)
- [UIExtensionContext](js-apis-inner-application-uiExtensionContext.md)
- [shellCmdResult](js-apis-inner-application-shellCmdResult.md)
- [WindowExtensionContext](js-apis-inner-application-windowExtensionContext.md)
- wantAgent
......@@ -205,12 +208,13 @@
- [@ohos.curves (Interpolation Calculation)](js-apis-curve.md)
- [@ohos.font (Custom Font Registration)](js-apis-font.md)
- [@ohos.matrix4 (Matrix Transformation)](js-apis-matrix4.md)
- [@ohos.measure (Text Measurement)](js-apis-measure.md)
- [@ohos.mediaquery (Media Query)](js-apis-mediaquery.md)
- [@ohos.pluginComponent (PluginComponentManager)](js-apis-plugincomponent.md)
- [@ohos.promptAction (Prompt)](js-apis-promptAction.md)
- [@ohos.router (Page Routing)](js-apis-router.md)
- [@ohos.measure (Text Measurement)](js-apis-measure.md)
- [@ohos.uiAppearance (UI Appearance)](js-apis-uiappearance.md)
- Graphics
- [@ohos.animation.windowAnimationManager (Window Animation Management)](js-apis-windowAnimationManager.md)
- [@ohos.application.WindowExtensionAbility (WindowExtensionAbility)](js-apis-application-windowExtensionAbility.md)
......@@ -225,12 +229,15 @@
- [WebGL2](js-apis-webgl2.md)
- Multimedia
- [@ohos.app.ability.MediaControlExtensionAbility (ExtensionAbility for Media Playback Control)](js-apis-app-ability-MediaControlExtensionAbility.md)
- [@ohos.multimedia.audio (Audio Management)](js-apis-audio.md)
- [@ohos.multimedia.avsession (AVSession Management)](js-apis-avsession.md)
- [@ohos.multimedia.camera (Camera Management)](js-apis-camera.md)
- [@ohos.multimedia.image (Image Processing)](js-apis-image.md)
- [@ohos.multimedia.media (Media)](js-apis-media.md)
- [@ohos.multimedia.systemSoundManager (System Sound Management)](js-apis-systemSoundManager.md)
- application
- [MediaControlExtensionContext (ExtensionAbility Context for Media Playback Control)](js-apis-inner-application-MediaControlExtensionContext.md)
- multimedia
- [ringtonePlayer (Ringtone Player)](js-apis-inner-multimedia-ringtonePlayer.md)
......@@ -413,7 +420,7 @@
- [@ohos.account.appAccount.AuthorizationExtensionAbility (App AuthorizationExtensionAbility)](js-apis-appAccount-authorizationExtensionAbility.md)
- [@ohos.account.distributedAccount (Distributed Account Management)](js-apis-distributed-account.md)
- [@ohos.account.osAccount (OS Account Management)](js-apis-osAccount.md)
- Customization
- [@ohos.configPolicy (Configuration Policy)](js-apis-configPolicy.md)
......
# @ohos.app.ability.MediaControlExtensionAbility (ExtensionAbility for Media Playback Control)
The **MediaControlExtensionAbility** module, inherited from [UIExtensionAbility](js-apis-app-ability-uiExtensionAbility.md), provides ExtensionAbilities for media playback control. No APIs are added. During actual development, you need to implement the APIs in the parent class to use the lifecycle and capabilities of UIExtensionAbilities. You cannot directly call the base class.
**System capability**: SystemCapability.Multimedia.AVSession.Core
> **NOTE**
>
> - The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The APIs of this module can be used only in the stage model.
> - The APIs provided by this module are system APIs.
## Modules to Import
```js
import MediaControlExtensionAbility from @ohos.app.ability.MediaControlExtensionAbility;
```
# MediaControlExtensionContext (ExtensionAbility Context for Media Playback Control)
**MediaControlExtensionContext**, inherited from [UIExtensionContext](js-apis-inner-application-uiExtensionContext.md), provides the context environment for [MediaControlExtensionAbility](js-apis-app-ability-MediaControlExtensionAbility.md). It provides MediaControlExtensionAbility-related configuration and APIs for operating the MediaControlExtensionAbility. For example, you can use the APIs to start a MediaControlExtensionAbility.
**System capability**: SystemCapability.Multimedia.AVSession.Core
> **NOTE**
>
> - The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The APIs of this module can be used only in the stage model.
> - The APIs provided by this module are system APIs.
......@@ -24,7 +24,8 @@
- [Audio Error Codes](errorcode-audio.md)
- [Media Error Codes](errorcode-media.md)
- [AVSession Management Error Codes](errorcode-avsession.md)
- Resource Manager
- [Camera Error Codes](errorcode-camera.md)
- Resource Management
- [I18N Error Codes](errorcode-i18n.md)
- [Resource Manager Error Codes](errorcode-resource-manager.md)
- Background Task
......@@ -55,11 +56,12 @@
- [Network Connection Management Error Codes](errorcode-net-connection.md)
- [Ethernet Connection Error Codes](errorcode-net-ethernet.md)
- [Network Sharing Error Codes](errorcode-net-sharing.md)
- [Policy Management Error Codes](errorcode-net-policy.md)
- [mDNS Error Codes](errorcode-net-mdns.md)
- [Traffic Management Error Codes](errorcode-net-statistics.md)
- Connectivity
- [Bluetooth Error Codes](errorcode-bluetoothManager.md)
- [Wi-Fi Error Codes](errorcode-wifi.md)
- [Wi-Fi Error Codes](errorcode-wifi.md)
- [NFC Error Codes](errorcode-nfc.md)
- [SE Error Codes](errorcode-se.md)
- [RPC Error Codes](errorcode-rpc.md)
......@@ -86,7 +88,7 @@
- [Device Management Error Codes](errorcode-device-manager.md)
- [Location Subsystem Error Codes](errorcode-geoLocationManager.md)
- [Screen Hopping Error Codes](errorcode-devicestatus.md)
- [Screen Hopping Error Codes (to Be Deprecated)](errorcode-multimodalinput.md)
- [Screen Hopping Error Codes (To Be Deprecated Soon)](errorcode-multimodalinput.md)
- [Sensor Error Codes](errorcode-sensor.md)
- [Vibrator Error Codes](errorcode-vibrator.md)
- [System Parameter Error Codes](errorcode-system-parameterV9.md)
......@@ -94,7 +96,7 @@
- [Update Error Codes](errorcode-update.md)
- Customization
- [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md)
- Common Library Library
- Common Library
- [Common Library Error Codes](errorcode-utils.md)
- Test
- [UiTest Error Codes](errorcode-uitest.md)
# Camera Error Codes
> **NOTE**
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
## 7400101 Invalid Parameter
**Error Message**
Parameter missing or parameter type incorrect.
**Error Description**
A parameter passed in the API is invalid.
**Possible Cause**
The parameter is invalid. For example, the parameter value is not within the range supported.
**Solution**
Pass the correct parameters in the API.
## 7400102 Invalid Operation
**Error Message**
Operation not allowed.
**Error Description**
The operation is not performed in the specified mode.
**Possible Cause**
The API execution sequence is incorrect. For example, the **commitConfig** API is called in prior to **beginConfig**.
**Solution**
Perform operations according to the API reference and guide.
## 7400103 Session Not Configured
**Error Message**
Session not config.
**Error Description**
An operation that requires session configuration is performed before the session is configured.
**Possible Cause**
For example, the **start()** API is called before the session is configured.
**Solution**
Configure the session first.
## 7400104 Session Not Running
**Error Message**
Session not running.
**Error Description**
An operation that requires a running session is performed before the session runs.
**Possible Cause**
For example, the **capture()** API is called before the session runs.
**Solution**
Perform the operation to run the session first.
## 7400105 Session Configuration Locked
**Error Message**
Session config locked.
**Error Description**
The session configuration is locked.
**Possible Cause**
Another thread has locked the session configuration.
**Solution**
Wait until the session configuration is unlocked.
## 7400106 Device Configuration Locked
**Error Message**
Device setting locked.
**Error Description**
The device configuration is locked.
**Possible Cause**
Another thread has locked the device configuration.
**Solution**
Wait until the device configuration is unlocked.
## 7400107 Camera Conflict
**Error Message**
Can not use camera cause of conflict.
**Error Description**
The camera cannot be used due to a conflict.
**Possible Cause**
The opened camera conflicts with the local camera to be used.
**Solution**
Wait until the conflicting camera is released.
## 7400108 Camera Disabled Due to Security Reasons
**Error Message**
Camera disabled cause of security reason.
**Error Description**
The camera cannot be used due to security policies.
**Possible Cause**
The application running in the background attempts to open the camera.
**Solution**
Switch the application to the foreground first.
## 7400109 Camera Preempted
**Error Message**
Can not use camera cause of preempted.
**Error Description**
The camera cannot be used because it is preempted.
**Possible Cause**
Two applications attempt to open the same camera simultaneously.
**Solution**
N/A
## 7400201 Camera Service Error
**Error Message**
Camera service fatal error.
**Error Description**
The camera service is abnormal.
**Possible Cause**
For example, the camera service is restarted or cross-process invoking is abnormal.
**Solution**
Create the service again.
......@@ -144,9 +144,10 @@
- [Component Startup Rules (Stage Model)](application-models/component-startup-rules.md)
- Inter-Device Application Component Interaction (Continuation)
- [Continuation Overview](application-models/inter-device-interaction-hop-overview.md)
- [Cross-Device Migration (for System Applications Only)](application-models/hop-cross-device-migration.md)
- [Cross-Device Migration](application-models/hop-cross-device-migration.md)
- [Multi-device Collaboration (for System Applications Only)](application-models/hop-multi-device-collaboration.md)
- [Subscribing to System Environment Variable Changes](application-models/subscribe-system-environment-variable-changes.md)
- [Setting Atomic Services to Support Sharing](application-models/atomic-services-support-sharing.md)
- Process Model
- [Process Model Overview](application-models/process-model-stage.md)
- Common Events
......@@ -478,6 +479,7 @@
- [Developing Audio Call](media/audio-call-development.md)
- [Video Playback](media/video-playback.md)
- [Video Recording](media/video-recording.md)
- [Screen Capture](media/avscreen-capture.md)
- Audio and Video Codecs
- [Obtaining Supported Codecs](media/obtain-supported-codecs.md)
- [Audio Encoding](media/audio-encoding.md)
......@@ -544,9 +546,9 @@
- [hapsigner Guide](security/hapsigntool-guidelines.md)
- [HarmonyAppProvision Configuration File](security/app-provision-structure.md)
- AI
- [AI Development](./ai/ai-overview.md)
- [Using MindSpore Lite JavaScript APIs to Develop AI Applications](./ai/mindspore-guidelines-based-js.md)
- [Using MindSpore Lite Native APIs to Develop AI Applications](./ai/mindspore-guidelines-based-native.md)
- [AI Development](ai/ai-overview.md)
- [Using MindSpore Lite JavaScript APIs to Develop AI Applications](ai/mindspore-guidelines-based-js.md)
- [Using MindSpore Lite Native APIs to Develop AI Applications](ai/mindspore-guidelines-based-native.md)
- Connectivity
- Network Management
- [Network Management Overview](connectivity/net-mgmt-overview.md)
......@@ -624,12 +626,12 @@
- [Setting the Security Level of a Distributed File](file-management/set-security-label.md)
- [Accessing Files Across Devices](file-management/file-access-across-devices.md)
- Background Task Management
- [Background Task Overview](task-management/background-task-overview.md)
- [Transient Task](task-management/transient-task.md)
- [Continuous Task](task-management/continuous-task.md)
- [Deferred Task](task-management/work-scheduler.md)
- [Agent-powered Reminder](task-management/agent-powered-reminder.md)
- [Requesting Efficiency Resources (for Privileged System Applications Only)](task-management/efficiency-resource-request.md)
- [Background Task Overview](task-management/background-task-overview.md)
- [Transient Task](task-management/transient-task.md)
- [Continuous Task](task-management/continuous-task.md)
- [Deferred Task](task-management/work-scheduler.md)
- [Agent-powered Reminder](task-management/agent-powered-reminder.md)
- [Requesting Efficiency Resources (for Privileged System Applications Only)](task-management/efficiency-resource-request.md)
- Device Management
- USB Service
- [USB Service Overview](device/usb-overview.md)
......@@ -680,6 +682,7 @@
- Native APIs
- [Using Native APIs in Application Projects](napi/napi-guidelines.md)
- Graphics
- [XComponent Development](napi/xcomponent-guidelines.md)
- [Drawing Development](napi/drawing-guidelines.md)
- [NativeBuffer Development](napi/native-buffer-guidelines.md)
- [NativeImage Development](napi/native-image-guidelines.md)
......@@ -730,6 +733,8 @@
- [@ohos.app.ability.ServiceExtensionAbility (ServiceExtensionAbility)](reference/apis/js-apis-app-ability-serviceExtensionAbility.md)
- [@ohos.app.ability.StartOptions (StartOptions)](reference/apis/js-apis-app-ability-startOptions.md)
- [@ohos.app.ability.UIAbility (UIAbility)](reference/apis/js-apis-app-ability-uiAbility.md)
- [@ohos.app.ability.UIExtensionAbility (Base Class for ExtensionAbilities with UI)](reference/apis/js-apis-app-ability-uiExtensionAbility.md)
- [@ohos.app.ability.UIExtensionContentSession (UI Operation Class for ExtensionAbilities with UI)](reference/apis/js-apis-app-ability-uiExtensionContentSession.md)
- [@ohos.app.form.FormExtensionAbility (FormExtensionAbility)](reference/apis/js-apis-app-form-formExtensionAbility.md)
- [@ohos.application.DataShareExtensionAbility (DataShareExtensionAbility)](reference/apis/js-apis-application-dataShareExtensionAbility.md)
- [@ohos.application.StaticSubscriberExtensionAbility (StaticSubscriberExtensionAbility)](reference/apis/js-apis-application-staticSubscriberExtensionAbility.md)
......@@ -820,6 +825,7 @@
- [ProcessInformation](reference/apis/js-apis-inner-application-processInformation.md)
- [ServiceExtensionContext](reference/apis/js-apis-inner-application-serviceExtensionContext.md)
- [UIAbilityContext](reference/apis/js-apis-inner-application-uiAbilityContext.md)
- [UIExtensionContext](reference/apis/js-apis-inner-application-uiExtensionContext.md)
- [shellCmdResult](reference/apis/js-apis-inner-application-shellCmdResult.md)
- [WindowExtensionContext](reference/apis/js-apis-inner-application-windowExtensionContext.md)
- wantAgent
......@@ -935,12 +941,15 @@
- [WebGL](reference/apis/js-apis-webgl.md)
- [WebGL2](reference/apis/js-apis-webgl2.md)
- Multimedia
- [@ohos.app.ability.MediaControlExtensionAbility (ExtensionAbility for Media Playback Control)](reference/apis/js-apis-app-ability-MediaControlExtensionAbility.md)
- [@ohos.multimedia.audio (Audio Management)](reference/apis/js-apis-audio.md)
- [@ohos.multimedia.avsession (AVSession Management)](reference/apis/js-apis-avsession.md)
- [@ohos.multimedia.camera (Camera Management)](reference/apis/js-apis-camera.md)
- [@ohos.multimedia.image (Image Processing)](reference/apis/js-apis-image.md)
- [@ohos.multimedia.media (Media)](reference/apis/js-apis-media.md)
- [@ohos.multimedia.systemSoundManager (System Sound Management)](reference/apis/js-apis-systemSoundManager.md)
- application
- [MediaControlExtensionContext (ExtensionAbility Context for Media Playback Control)](reference/apis/js-apis-inner-application-MediaControlExtensionContext.md)
- multimedia
- [ringtonePlayer (Ringtone Player)](reference/apis/js-apis-inner-multimedia-ringtonePlayer.md)
- Resource Management
......@@ -1336,6 +1345,7 @@
- [GridRow](reference/arkui-ts/ts-container-gridrow.md)
- [Grid](reference/arkui-ts/ts-container-grid.md)
- [GridItem](reference/arkui-ts/ts-container-griditem.md)
- [Hyperlink](reference/arkui-ts/ts-container-hyperlink.md)
- [List](reference/arkui-ts/ts-container-list.md)
- [ListItem](reference/arkui-ts/ts-container-listitem.md)
- [ListItemGroup](reference/arkui-ts/ts-container-listitemgroup.md)
......@@ -1351,6 +1361,7 @@
- [Swiper](reference/arkui-ts/ts-container-swiper.md)
- [Tabs](reference/arkui-ts/ts-container-tabs.md)
- [TabContent](reference/arkui-ts/ts-container-tabcontent.md)
- [UIExtensionComponent](reference/arkui-ts/ts-container-ui-extension-component.md)
- [WaterFlow](reference/arkui-ts/ts-container-waterflow.md)
- Media Components
- [Video](reference/arkui-ts/ts-media-components-video.md)
......@@ -1603,6 +1614,7 @@
- [Audio Error Codes](reference/errorcodes/errorcode-audio.md)
- [Media Error Codes](reference/errorcodes/errorcode-media.md)
- [AVSession Management Error Codes](reference/errorcodes/errorcode-avsession.md)
- [Camera Error Codes](reference/errorcodes/errorcode-camera.md)
- Resource Management
- [I18N Error Codes](reference/errorcodes/errorcode-i18n.md)
- [Resource Manager Error Codes](reference/errorcodes/errorcode-resource-manager.md)
......@@ -1622,7 +1634,7 @@
- [DataShare Error Codes](reference/errorcodes/errorcode-datashare.md)
- [Distributed Data Object Error Codes](reference/errorcodes/errorcode-distributed-dataObject.md)
- [Distributed KV Store Error Codes](reference/errorcodes/errorcode-distributedKVStore.md)
- [Preferences Error Codes](reference/errorcodes/errorcode-preferences.md)
- [User Preference Error Codes](reference/errorcodes/errorcode-preferences.md)
- File Management
- [File Management Error Codes](reference/errorcodes/errorcode-filemanagement.md)
- Telephony Service
......@@ -1656,7 +1668,7 @@
- [Time and Time Zone Service Error Codes](reference/errorcodes/errorcode-time.md)
- [Webview Error Codes](reference/errorcodes/errorcode-webview.md)
- Account Management
- [Account Error Codes](reference/errorcodes/errorcode-account.md)
- [Account Management Error Codes](reference/errorcodes/errorcode-account.md)
- Device Management
- [Power Consumption Statistics Error Codes](reference/errorcodes/errorcode-batteryStatistics.md)
- [Brightness Error Codes](reference/errorcodes/errorcode-brightness.md)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册