openharmony 鸿蒙 arkts-apis-camera-AutoDeviceSwitchQuery

2026-08-25 浏览 (1)

Interface (AutoDeviceSwitchQuery)

AutoDeviceSwitchQuery is used to check whether a device supports automatic camera switch.

Automatic Camera Switching is supported only on foldable devices. For details about how to enable this capability, see enableAutoDeviceSwitch.

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 initial APIs of this interface are supported since API version 13.

Modules to Import

import { camera } from '@kit.CameraKit';

isAutoDeviceSwitchSupported13+

isAutoDeviceSwitchSupported(): boolean

Checks whether the device supports automatic camera switch.

Atomic service API: This API can be used in atomic services since API version 19.

System capability: SystemCapability.Multimedia.Camera.Core

Return value

TypeDescription
booleanCheck result for the support of automatic camera switch. true if supported, false otherwise.

Example


// Check whether the foldable device supports automatic camera switch.
// If the sample code returns **true**, you can continue to use enableAutoDeviceSwitch to enable automatic camera switching.
function isAutoDeviceSwitchSupported(session: camera.PhotoSession): boolean {
  let isSupported = false;
  isSupported = session.isAutoDeviceSwitchSupported();
  return isSupported;
}

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-oh-camera-capturesession-callbacks

openharmony 鸿蒙 arkts-apis-camera-OIS

openharmony 鸿蒙 capi-oh-camera-camera-devicequeryinfo

openharmony 鸿蒙 capi-oh-camera-camera-frameraterange

openharmony 鸿蒙 capi-oh-camera-camera-outputcapability

openharmony 鸿蒙 arkts-apis-camera-Photo

openharmony 鸿蒙 capi-oh-camera-camera-profile

openharmony 鸿蒙 capi-oh-camera-camera-manager

openharmony 鸿蒙 capi-oh-camera-previewoutput-callbacks

openharmony 鸿蒙 arkts-apis-camera-ManualExposureQuery

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/0ycbD2e6