• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Interface (StabilizationQuery)
2<!--Kit: Camera Kit-->
3<!--Subsystem: Multimedia-->
4<!--Owner: @qano-->
5<!--SE: @leo_ysl-->
6<!--TSE: @xchaosioda-->
7
8> **NOTE**
9>
10> - 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.
11> - This interface was first introduced in API version 12. In this version, a compatibility change was made that preserved the initial version information of inner elements. As a result, you might see outer element's @since version number being higher than that of the inner elements. However, this discrepancy does not affect the functionality of the interface.
12
13StabilizationQuery provides APIs to check the support for video stabilization.
14
15## Modules to Import
16
17```ts
18import { camera } from '@kit.CameraKit';
19```
20
21## isVideoStabilizationModeSupported<sup>11+</sup>
22
23isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean
24
25Checks whether a video stabilization mode is supported.
26
27**Atomic service API**: This API can be used in atomic services since API version 19.
28
29**System capability**: SystemCapability.Multimedia.Camera.Core
30
31**Parameters**
32
33| Name     | Type                                             | Mandatory| Description                            |
34| -------- | ------------------------------------------------- | ---- | ------------------------------ |
35| vsMode   | [VideoStabilizationMode](arkts-apis-camera-e.md#videostabilizationmode) | Yes  | Video stabilization mode.                   |
36
37**Return value**
38
39| Type       | Description                         |
40| ---------- | ----------------------------- |
41| boolean    | Check result for the support of the video stabilization mode. **true** if supported, **false** otherwise. If the operation fails, an error code defined in [CameraErrorCode](arkts-apis-camera-e.md#cameraerrorcode) is returned.|
42
43**Error codes**
44
45For details about the error codes, see [Camera Error Codes](errorcode-camera.md).
46
47| ID        | Error Message       |
48| --------------- | --------------- |
49| 7400103                |  Session not config, only throw in session usage.             |
50
51**Example**
52
53```ts
54import { BusinessError } from '@kit.BasicServicesKit';
55
56function isVideoStabilizationModeSupported(videoSession: camera.VideoSession): boolean {
57  let isSupported: boolean = false;
58  try {
59    isSupported = videoSession.isVideoStabilizationModeSupported(camera.VideoStabilizationMode.OFF);
60  } catch (error) {
61    // If the operation fails, error.code is returned and processed.
62    let err = error as BusinessError;
63    console.error(`The isVideoStabilizationModeSupported call failed. error code: ${err.code}`);
64  }
65  return isSupported;
66}
67```
68