StabilizationQuery provides APIs to check the support for video stabilization.
isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean
Checks whether a video stabilization mode is supported.
Atomic service API: This API can be used in atomic services since API version 19.
System capability: SystemCapability.Multimedia.Camera.Core
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| vsMode | VideoStabilizationMode | Yes | Video stabilization mode. |
Return value
| Type | Description |
|---|---|
| boolean | Check result for the support of the video stabilization mode. true if supported, false otherwise. If the operation fails, undefined is returned and an error code defined in CameraErrorCode is thrown. |
Error codes
For details about the error codes, see Camera Error Codes.
| ID | Error Message |
|---|---|
| 7400103 | Session not config, only throw in session usage. |
Example
import { BusinessError } from '@kit.BasicServicesKit';
function isVideoStabilizationModeSupported(videoSession: camera.VideoSession): boolean {
let isSupported: boolean = false;
try {
isSupported = videoSession.isVideoStabilizationModeSupported(camera.VideoStabilizationMode.OFF);
} catch (error) {
// If the operation fails, error.code is returned and processed.
let err = error as BusinessError;
console.error(`The isVideoStabilizationModeSupported call failed. error code: ${err.code}`);
}
return isSupported;
}