source
stringlengths
14
113
code
stringlengths
10
21.3k
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function createVideoOutput(cameraManager: camera.CameraManager, surfaceId: string): camera.VideoOutput | undefined { let videoOutput: camera.VideoOutput | undefined = undefined; try { videoOutput = cameraManager.createVideoOutput(surfaceId); } catch (err...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function createMetadataOutput(cameraManager: camera.CameraManager, cameraOutputCapability: camera.CameraOutputCapability): void { let metadataObjectTypes: Array<camera.MetadataObjectType> = cameraOutputCapability.supportedMetadataObjectTypes; let metadataOutpu...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function createCaptureSession(cameraManager: camera.CameraManager): camera.CaptureSession | undefined { let captureSession: camera.CaptureSession | undefined = undefined; try { captureSession = cameraManager.createCaptureSession(); } catch (error) { ...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function createSession(cameraManager: camera.CameraManager, mode: camera.SceneMode): camera.Session | undefined { let photoSession: camera.PhotoSession | undefined = undefined; try { photoSession = cameraManager.createSession(mode) as camera.PhotoSession; ...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError, cameraStatusInfo: camera.CameraStatusInfo): void { if (err !== undefined && err.code !== 0) { console.error('cameraStatus with errorCode = ' + err.code); return; } console.info(`camera : ${cameraStatusInfo.camera...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterCameraStatus(cameraManager: camera.CameraManager): void { cameraManager.off('cameraStatus'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError, foldStatusInfo: camera.FoldStatusInfo): void { if (err !== undefined && err.code !== 0) { console.error('foldStatusChange with errorCode = ' + err.code); return; } console.info(`camera length: ${foldStatusInfo.su...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterFoldStatusChange(cameraManager: camera.CameraManager): void { cameraManager.off('foldStatusChange'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function isTorchSupported(cameraManager: camera.CameraManager): boolean { let isSupported = cameraManager.isTorchSupported(); return isSupported; }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function isTorchModeSupported(cameraManager: camera.CameraManager, torchMode: camera.TorchMode): boolean { let isSupported = cameraManager.isTorchModeSupported(torchMode); return isSupported; }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function getTorchMode(cameraManager: camera.CameraManager): camera.TorchMode | undefined { let torchMode: camera.TorchMode | undefined = undefined; torchMode = cameraManager.getTorchMode(); return torchMode; }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function setTorchMode(cameraManager: camera.CameraManager, torchMode: camera.TorchMode): void { try { cameraManager.setTorchMode(torchMode); } catch (error) { // If the operation fails, error.code is returned and processed. let err = error as Busin...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError, torchStatusInfo: camera.TorchStatusInfo): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } console.info(`onTorchStatusChange, isTorchAvailable: ...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterTorchStatusChange(cameraManager: camera.CameraManager): void { cameraManager.off('torchStatusChange'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { camera } from '@kit.CameraKit'; function getCameraDevice(cameraManager: camera.CameraManager, position: camera.CameraPosition, type: camera.CameraType): void { try { let curCameraDev: camera.CameraDevice | undefined = undefined; curCameraDev = cameraManager.getCameraDevice(position, type); } catch...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { camera } from '@kit.CameraKit'; function getCameraConcurrentInfos(cameraManager: camera.CameraManager, cameraDeviceArray: Array<camera.CameraDevice>): void { try { let cameraconcurrentinfos: Array<camera.CameraConcurrentInfo> = []; cameraconcurrentinfos = cameraManager.getCameraConcurrentInfos(camer...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function openCameraInput(cameraInput: camera.CameraInput): void { cameraInput.open((err: BusinessError) => { if (err) { console.error(`Failed to open the camera, error code: ${err.code}.`); return; } console.info('Callback returned with c...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function openCameraInput(cameraInput: camera.CameraInput): void { cameraInput.open().then(() => { console.info('Promise returned with camera opened.'); }).catch((error: BusinessError) => { console.error(`Failed to open the camera, error code: ${error.c...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function openCameraInput(cameraInput: camera.CameraInput): void { cameraInput.open(true).then(() => { console.info('Promise returned with camera opened.'); }).catch((error: BusinessError) => { console.error(`Failed to open the camera, error code: ${err...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function openCameraInput(cameraInput: camera.CameraInput): void { cameraInput.open(0).then(() => { console.info('Promise returned with camera opened.'); }).catch((error: BusinessError) => { console.error(`Failed to open the camera, error code: ${error....
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function closeCameraInput(cameraInput: camera.CameraInput): void { cameraInput.close((err: BusinessError) => { if (err) { console.error(`Failed to close the cameras, error code: ${err.code}.`); return; } console.info('Callback returned wi...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function closeCameraInput(cameraInput: camera.CameraInput): void { cameraInput.close().then(() => { console.info('Promise returned with camera closed.'); }).catch((error: BusinessError) => { console.error(`Failed to close the cameras, error code: ${err...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError): void { console.error(`Camera input error code: ${err.code}`); } function registerCameraInputError(cameraInput: camera.CameraInput, camera: camera.CameraDevice): void { cameraInput.on('error', camera, callback); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterCameraInputError(cameraInput: camera.CameraInput, camera: camera.CameraDevice): void { cameraInput.off('error', camera); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function releasePreviewOutput(previewOutput: camera.PreviewOutput): void { previewOutput.release((err: BusinessError) => { if (err) { console.error(`Failed to release the Preview output instance ${err.code}`); return; } console.info('Call...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function releasePreviewOutput(previewOutput: camera.PreviewOutput): void { previewOutput.release().then(() => { console.info('Promise returned to indicate that the preview output instance is released successfully.'); }).catch((error: BusinessError) => { ...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function startPreviewOutput(previewOutput: camera.PreviewOutput): void { previewOutput.start((err: BusinessError) => { if (err) { console.error(`Failed to start the preview output, error code: ${err.code}.`); return; } console.info('Callb...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function startPreviewOutput(previewOutput: camera.PreviewOutput): void { previewOutput.start().then(() => { console.info('Promise returned with preview output started.'); }).catch((error: BusinessError) => { console.error(`Failed to preview output star...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function stopPreviewOutput(previewOutput: camera.PreviewOutput): void { previewOutput.stop((err: BusinessError) => { if (err) { console.error(`Failed to stop the preview output, error code: ${err.code}.`); return; } console.info('Returned...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function stopPreviewOutput(previewOutput: camera.PreviewOutput): void { previewOutput.stop().then(() => { console.info('Callback returned with preview output stopped.'); }).catch((error: BusinessError) => { console.error(`Failed to preview output stop,...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } console.info('Preview frame started'); } function registerPreviewOutputFrameStart(previewOutp...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterPreviewOutputFrameStart(previewOutput: camera.PreviewOutput): void { previewOutput.off('frameStart'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } console.info('Preview frame ended'); } function registerPreviewOutputFrameEnd(previewOutput: ...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterPreviewOutputFrameEnd(previewOutput: camera.PreviewOutput): void { previewOutput.off('frameEnd'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(previewOutputError: BusinessError): void { console.error(`Preview output error code: ${previewOutputError.code}`); } function registerPreviewOutputError(previewOutput: camera.PreviewOutput): void { previewOutput.on('error', callback) }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterPreviewOutputError(previewOutput: camera.PreviewOutput): void { previewOutput.off('error'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function getSupportedFrameRates(previewOutput: camera.PreviewOutput): Array<camera.FrameRateRange> { let supportedFrameRatesArray: Array<camera.FrameRateRange> = previewOutput.getSupportedFrameRates(); return supportedFrameRatesArray; }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function setFrameRateRange(previewOutput: camera.PreviewOutput, frameRateRange: Array<number>): void { previewOutput.setFrameRate(frameRateRange[0], frameRateRange[1]); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function getActiveFrameRate(previewOutput: camera.PreviewOutput): camera.FrameRateRange { let activeFrameRate: camera.FrameRateRange = previewOutput.getActiveFrameRate(); return activeFrameRate; }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function testGetActiveProfile(previewOutput: camera.PreviewOutput): camera.Profile | undefined { let activeProfile: camera.Profile | undefined = undefined; try { activeProfile = previewOutput.getActiveProfile(); } catch (error) { // If the operation fails, error.code is returned and processed. let err...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function testGetPreviewRotation(previewOutput: camera.PreviewOutput, imageRotation : camera.ImageRotation): camera.ImageRotation { let previewRotation: camera.ImageRotation = camera.ImageRotation.ROTATION_0; try { previewRotation = previewOutput.getPreviewRotation(imageRotation); console.log(`Preview rotati...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function testSetPreviewRotation(previewOutput: camera.PreviewOutput, previewRotation : camera.ImageRotation, isDisplayLocked: boolean): void { try { previewOutput.setPreviewRotation(previewRotation, isDisplayLocked); } catch (error) { // If the operation fails, error.code is returned and processed. let ...
application-dev\reference\apis-camera-kit\js-apis-camera.md
async function releasePhoto(photo: camera.Photo): Promise<void> { await photo.release(); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function capture(photoOutput: camera.PhotoOutput): void { photoOutput.capture((err: BusinessError) => { if (err) { console.error(`Failed to capture the photo, error code: ${err.code}.`); return; } console.info('Callback invoked to indicat...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function capture(photoOutput: camera.PhotoOutput): void { photoOutput.capture().then(() => { console.info('Promise returned to indicate that photo capture request success.'); }).catch((error: BusinessError) => { console.error(`Failed to photo output ca...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function capture(photoOutput: camera.PhotoOutput): void { let captureLocation: camera.Location = { latitude: 0, longitude: 0, altitude: 0 } let settings: camera.PhotoCaptureSetting = { quality: camera.QualityLevel.QUALITY_LEVEL_LOW, rotat...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function capture(photoOutput: camera.PhotoOutput): void { let captureLocation: camera.Location = { latitude: 0, longitude: 0, altitude: 0 } let settings: camera.PhotoCaptureSetting = { quality: camera.QualityLevel.QUALITY_LEVEL_LOW, rotat...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; import { image } from '@kit.ImageKit'; function callback(err: BusinessError, photo: camera.Photo): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } let mainImage: image.Image = photo...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; import { image } from '@kit.ImageKit'; function callback(err: BusinessError, photo: camera.Photo): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } let mainImage: image.Image = photo...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError, captureStartInfo: camera.CaptureStartInfo): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } console.info(`photo capture started, captureStartIn...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function unRegisterCaptureStartWithInfo(photoOutput: camera.PhotoOutput): void { photoOutput.off('captureStartWithInfo'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function isMovingPhotoSupported(photoOutput: camera.PhotoOutput): boolean { let isSupported: boolean = false; try { isSupported = photoOutput.isMovingPhotoSupported(); } catch (error) { // If the operation fails, error.code is returned and processed....
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function enableMovingPhoto(photoOutput: camera.PhotoOutput): void { try { photoOutput.enableMovingPhoto(true); } catch (error) { // If the operation fails, error.code is returned and processed. let err = error as BusinessError; console.error(`T...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; import { photoAccessHelper } from '@kit.MediaLibraryKit'; function photoAssetAvailableCallback(err: BusinessError, photoAsset: photoAccessHelper.PhotoAsset): void { if (err) { console.info(`photoAssetAvailable error: ${JSON.stringify(err)}.`); return; ...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function offPhotoOutputPhotoAssetAvailable(photoOutput: camera.PhotoOutput): void { photoOutput.off('photoAssetAvailable'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function isMirrorSupported(photoOutput: camera.PhotoOutput): boolean { let isSupported: boolean = photoOutput.isMirrorSupported(); return isSupported; }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function enableMirror(photoOutput: camera.PhotoOutput): void { try { photoOutput.enableMirror(true); } catch (error) { // If the operation fails, error.code is returned and processed. let err = error as BusinessError; console.error(`The enableM...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function getSupportedMovingPhotoVideoCodecType(photoOutput: camera.PhotoOutput): Array<camera.VideoCodecType> { let supportedVideoCodecTypesArray: Array<camera.VideoCodecType> = photoOutput.getSupportedMovingPhotoVideoCodecTypes(); return supportedVideoCodecTypesArray; }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function setMovingPhotoVideoCodecTypes(photoOutput: camera.PhotoOutput, videoCodecType: camera.VideoCodecType): void { photoOutput.setMovingPhotoVideoCodecType(videoCodecType); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError, captureId: number): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } console.info(`photo capture started, captureId : ${captureId}`); } functio...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterPhotoOutputCaptureStart(photoOutput: camera.PhotoOutput): void { photoOutput.off('captureStart'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError, frameShutterInfo: camera.FrameShutterInfo): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } console.info(`CaptureId for frame : ${frameShutterI...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterPhotoOutputFrameShutter(photoOutput: camera.PhotoOutput): void { photoOutput.off('frameShutter'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError, captureEndInfo: camera.CaptureEndInfo): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } console.info(`photo capture end, captureId : ${captureE...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterPhotoOutputCaptureEnd(photoOutput: camera.PhotoOutput): void { photoOutput.off('captureEnd'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError, frameShutterEndInfo: camera.FrameShutterEndInfo): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } console.info(`CaptureId for frame : ${frameSh...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterPhotoOutputFrameShutterEnd(photoOutput: camera.PhotoOutput): void { photoOutput.off('frameShutterEnd'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } console.info(`photo capture ready`); } function registerPhotoOutputCaptureReady(photoOutput: ...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterPhotoOutputCaptureReady(photoOutput: camera.PhotoOutput): void { photoOutput.off('captureReady'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError, duration: number): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } console.info(`photo estimated capture duration : ${duration}`); } function ...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterPhotoOutputEstimatedCaptureDuration(photoOutput: camera.PhotoOutput): void { photoOutput.off('estimatedCaptureDuration'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError): void { console.error(`Photo output error code: ${err.code}`); } function registerPhotoOutputError(photoOutput: camera.PhotoOutput): void { photoOutput.on('error', callback); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterPhotoOutputError(photoOutput: camera.PhotoOutput): void { photoOutput.off('error'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function testGetActiveProfile(photoOutput: camera.PhotoOutput): camera.Profile | undefined { let activeProfile: camera.Profile | undefined = undefined; try { activeProfile = photoOutput.getActiveProfile(); } catch (error) { // If the operation fails, error.code is returned and processed. let err = err...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function testGetPhotoRotation(photoOutput: camera.PhotoOutput, deviceDegree : number): camera.ImageRotation { let photoRotation: camera.ImageRotation = camera.ImageRotation.ROTATION_0; try { photoRotation = photoOutput.getPhotoRotation(deviceDegree); console.log(`Photo rotation is: ${photoRotation}`); } c...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function startVideoOutput(videoOutput: camera.VideoOutput): void { videoOutput.start((err: BusinessError) => { if (err) { console.error(`Failed to start the video output, error code: ${err.code}.`); return; } console.info('Callback invoke...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function startVideoOutput(videoOutput: camera.VideoOutput): void { videoOutput.start().then(() => { console.info('Promise returned to indicate that start method execution success.'); }).catch((error: BusinessError) => { console.error(`Failed to video o...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function stopVideoOutput(videoOutput: camera.VideoOutput): void { videoOutput.stop((err: BusinessError) => { if (err) { console.error(`Failed to stop the video output, error code: ${err.code}.`); return; } console.info('Callback invoked t...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function stopVideoOutput(videoOutput: camera.VideoOutput): void { videoOutput.stop().then(() => { console.info('Promise returned to indicate that stop method execution success.'); }).catch((error: BusinessError) => { console.error(`Failed to video outp...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } console.info('Video frame started'); } function registerVideoOutputFrameStart(videoOutput: ca...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterVideoOutputFrameStart(videoOutput: camera.VideoOutput): void { videoOutput.off('frameStart'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } console.info('Video frame ended'); } function registerVideoOutputFrameEnd(videoOutput: camera...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterVideoOutputFrameEnd(videoOutput: camera.VideoOutput): void { videoOutput.off('frameEnd'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError): void { console.error(`Video output error code: ${err.code}`); } function registerVideoOutputError(videoOutput: camera.VideoOutput): void { videoOutput.on('error', callback); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterVideoOutputError(videoOutput: camera.VideoOutput): void { videoOutput.off('error'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function getSupportedFrameRates(videoOutput: camera.VideoOutput): Array<camera.FrameRateRange> { let supportedFrameRatesArray: Array<camera.FrameRateRange> = videoOutput.getSupportedFrameRates(); return supportedFrameRatesArray; }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function setFrameRateRange(videoOutput: camera.VideoOutput, frameRateRange: Array<number>): void { videoOutput.setFrameRate(frameRateRange[0], frameRateRange[1]); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function getActiveFrameRate(videoOutput: camera.VideoOutput): camera.FrameRateRange { let activeFrameRate: camera.FrameRateRange = videoOutput.getActiveFrameRate(); return activeFrameRate; }
application-dev\reference\apis-camera-kit\js-apis-camera.md
function testGetActiveProfile(videoOutput: camera.VideoOutput): camera.Profile | undefined { let activeProfile: camera.VideoProfile | undefined = undefined; try { activeProfile = videoOutput.getActiveProfile(); } catch (error) { // If the operation fails, error.code is returned and processed. let err ...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function testIsMirrorSupported(videoOutput: camera.VideoOutput): boolean { let isSupported: boolean = videoOutput.isMirrorSupported(); return isSupported; }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { camera } from '@kit.CameraKit'; import { media } from '@kit.MediaKit'; import { BusinessError } from '@kit.BasicServicesKit'; function enableMirror(videoOutput: camera.VideoOutput, mirrorMode: boolean, aVRecorder: media.AVRecorder, deviceDegree : number): void { try { videoOutput.enableMirror(mirr...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { camera } from '@kit.CameraKit'; import { Decimal } from '@kit.ArkTS'; import { sensor } from '@kit.SensorServiceKit'; import { BusinessError } from '@kit.BasicServicesKit'; function getVideoRotation(videoOutput: camera.VideoOutput): camera.ImageRotation { let videoRotation: camera.ImageRotation = camera.I...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function startMetadataOutput(metadataOutput: camera.MetadataOutput): void { metadataOutput.start((err: BusinessError) => { if (err) { console.error(`Failed to start metadata output, error code: ${err.code}.`); return; } console.info('Call...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function startMetadataOutput(metadataOutput: camera.MetadataOutput): void { metadataOutput.start().then(() => { console.info('Callback returned with metadata output started.'); }).catch((error: BusinessError) => { console.error(`Failed to metadata outp...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function stopMetadataOutput(metadataOutput: camera.MetadataOutput): void { metadataOutput.stop((err: BusinessError) => { if (err) { console.error(`Failed to stop the metadata output, error code: ${err.code}.`); return; } console.info('Cal...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function stopMetadataOutput(metadataOutput: camera.MetadataOutput): void { metadataOutput.stop().then(() => { console.info('Callback returned with metadata output stopped.'); }).catch((error: BusinessError) => { console.error(`Failed to metadata output...
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(err: BusinessError, metadataObjectArr: Array<camera.MetadataObject>): void { if (err !== undefined && err.code !== 0) { console.error(`Callback Error, errorCode: ${err.code}`); return; } console.info('metadata output metadataObjects...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterMetadataObjectsAvailable(metadataOutput: camera.MetadataOutput): void { metadataOutput.off('metadataObjectsAvailable'); }
application-dev\reference\apis-camera-kit\js-apis-camera.md
import { BusinessError } from '@kit.BasicServicesKit'; function callback(metadataOutputError: BusinessError): void { console.error(`Metadata output error code: ${metadataOutputError.code}`); } function registerMetadataOutputError(metadataOutput: camera.MetadataOutput): void { metadataOutput.on('error', callback);...
application-dev\reference\apis-camera-kit\js-apis-camera.md
function unregisterMetadataOutputError(metadataOutput: camera.MetadataOutput): void { metadataOutput.off('error'); }