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

!21536 挑单beta2

Merge pull request !21536 from zengyawen/cherry-pick-1690538850
......@@ -125,9 +125,9 @@ if (isSupported) {
| 接口 | 说明 |
| ---- | ---- |
| isPreLaunchSupported(camera: CameraDevice) : boolean | 判断指定cameraDevice是否支持预热启动。 |
| setPreLaunchConfig(preLaunchConfig: PreLaunchConfig) : void | 配置相机预热参数。 |
| preLaunch() : void | 用户点击系统相机图标,拉起相机应用的同时调用,下发预热请求,使能相机预热启动。 |
| isPrelaunchSupported(camera: CameraDevice) : boolean | 判断指定cameraDevice是否支持预热启动。 |
| setPrelaunchConfig(prelaunchConfig: PrelaunchConfig) : void | 配置相机预热参数。 |
| prelaunch() : void | 用户点击系统相机图标,拉起相机应用的同时调用,下发预热请求,使能相机预热启动。 |
### 开发示例
......@@ -142,7 +142,7 @@ if (isSupported) {
this.cameraManager = camera.getCameraManager(globalThis.abilityContext);
try {
this.cameraManager.preLaunch();
this.cameraManager.prelaunch();
} catch (error) {
console.error(`catch error: Code: ${error.code}, message: ${error.message}`)
}
......@@ -159,9 +159,9 @@ if (isSupported) {
this.cameraManager = camera.getCameraManager(globalThis.abilityContext);
let cameras = this.cameraManager.getSupportedCameras()
if(this.cameraManager.isPreLaunchSupported(cameras[0])) {
if(this.cameraManager.isPrelaunchSupported(cameras[0])) {
try {
this.cameraManager.setPreLaunchConfig({cameraDevice: cameras[0]});
this.cameraManager.setPrelaunchConfig({cameraDevice: cameras[0]});
} catch (error) {
console.error(`catch error: Code: ${error.code}, message: ${error.message}`)
}
......
......@@ -582,11 +582,11 @@ cameraManager.on('cameraMute', (err, curMuetd) => {
})
```
### isPreLaunchSupported
### isPrelaunchSupported
isPreLaunchSupported(camera: CameraDevice): boolean
isPrelaunchSupported(camera: CameraDevice): boolean
在setPreLaunchConfig接口使用前调用,用于判断指定cameraDevice是否支持预热启动。
在setPrelaunchConfig接口使用前调用,用于判断指定cameraDevice是否支持预热启动。
**系统接口:** 此接口为系统接口。
......@@ -617,14 +617,14 @@ isPreLaunchSupported(camera: CameraDevice): boolean
```js
this.cameraManager = camera.getCameraManager(globalThis.abilityContext);
let cameras = this.cameraManager.getSupportedCameras()
if(this.cameraManager.isPreLaunchSupported(cameras[0])) {
this.cameraManager.setPreLaunchConfig({cameraDevice: cameras[0]});
if(this.cameraManager.isPrelaunchSupported(cameras[0])) {
this.cameraManager.setPrelaunchConfig({cameraDevice: cameras[0]});
}
```
### setPreLaunchConfig
### setPrelaunchConfig
setPreLaunchConfig(preLaunchConfig: PreLaunchConfig): void
setPrelaunchConfig(prelaunchConfig: PrelaunchConfig): void
**系统接口:** 此接口为系统接口。
......@@ -636,7 +636,7 @@ setPreLaunchConfig(preLaunchConfig: PreLaunchConfig): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------- | ---- | --------- |
| preLaunchConfig | [PreLaunchConfig](#prelaunchconfig) | 是 | 预启动配置参数。|
| prelaunchConfig | [PrelaunchConfig](#prelaunchconfig) | 是 | 预启动配置参数。|
**错误码:**
......@@ -652,11 +652,18 @@ setPreLaunchConfig(preLaunchConfig: PreLaunchConfig): void
```js
this.cameraManager = camera.getCameraManager(globalThis.abilityContext);
let cameras = this.cameraManager.getSupportedCameras()
if(this.cameraManager.isPrelaunchSupported(cameras[0])) {
try {
this.cameraManager.setPrelaunchConfig({cameraDevice: cameras[0]});
} catch (error) {
console.error(`catch error: Code: ${error.code}, message: ${error.message}`);
}
}
```
### preLaunch
### prelaunch
preLaunch(): void
prelaunch(): void
用户点击系统相机图标,拉起相机应用同时调用,下发预热请求,使能相机预热启动。
......@@ -668,6 +675,11 @@ preLaunch(): void
```js
this.cameraManager = camera.getCameraManager(globalThis.abilityContext);
try {
this.cameraManager.prelaunch();
} catch (error) {
console.error(`catch error: Code: ${error.code}, message: ${error.message}`);
}
```
### createDeferredPreviewOutput
......@@ -710,7 +722,7 @@ function getDeferredPreviewOutput(context: Context, previewProfile: camera.Profi
}
```
## PreLaunchConfig
## PrelaunchConfig
相机预启动配置参数。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册