161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci* Copyright (C) 2021-2024 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci* Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci* you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci* You may obtain a copy of the License at 661847f8eSopenharmony_ci* 761847f8eSopenharmony_ci* http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci* 961847f8eSopenharmony_ci* Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci* distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci* See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci* limitations under the License. 1461847f8eSopenharmony_ci*/ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit MediaKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { ErrorCallback, AsyncCallback, Callback } from './@ohos.base'; 2261847f8eSopenharmony_ciimport audio from "./@ohos.multimedia.audio"; 2361847f8eSopenharmony_ciimport photoAccessHelper from "./@ohos.file.photoAccessHelper"; 2461847f8eSopenharmony_ciimport type image from './@ohos.multimedia.image'; 2561847f8eSopenharmony_ciimport type { SoundPool as _SoundPool } from './multimedia/soundPool'; 2661847f8eSopenharmony_ciimport type { PlayParameters as _PlayParameters } from './multimedia/soundPool'; 2761847f8eSopenharmony_ciimport type drm from './@ohos.multimedia.drm'; 2861847f8eSopenharmony_ci 2961847f8eSopenharmony_ci/** 3061847f8eSopenharmony_ci * @namespace media 3161847f8eSopenharmony_ci * @since 6 3261847f8eSopenharmony_ci */ 3361847f8eSopenharmony_ci/** 3461847f8eSopenharmony_ci * @namespace media 3561847f8eSopenharmony_ci * @atomicservice 3661847f8eSopenharmony_ci * @since 11 3761847f8eSopenharmony_ci */ 3861847f8eSopenharmony_ci/** 3961847f8eSopenharmony_ci * @namespace media 4061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 4161847f8eSopenharmony_ci * @crossplatform 4261847f8eSopenharmony_ci * @atomicservice 4361847f8eSopenharmony_ci * @since 12 4461847f8eSopenharmony_ci */ 4561847f8eSopenharmony_cideclare namespace media { 4661847f8eSopenharmony_ci /** 4761847f8eSopenharmony_ci * Creates an AVPlayer instance. 4861847f8eSopenharmony_ci * @param { AsyncCallback<AVPlayer> } callback - used to return AVPlayer instance if the operation is successful; returns null otherwise. 4961847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by callback. 5061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 5161847f8eSopenharmony_ci * @since 9 5261847f8eSopenharmony_ci */ 5361847f8eSopenharmony_ci /** 5461847f8eSopenharmony_ci * Creates an AVPlayer instance. 5561847f8eSopenharmony_ci * @param { AsyncCallback<AVPlayer> } callback - used to return AVPlayer instance if the operation is successful; returns null otherwise. 5661847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by callback. 5761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 5861847f8eSopenharmony_ci * @atomicservice 5961847f8eSopenharmony_ci * @since 11 6061847f8eSopenharmony_ci */ 6161847f8eSopenharmony_ci /** 6261847f8eSopenharmony_ci * Creates an AVPlayer instance. 6361847f8eSopenharmony_ci * @param { AsyncCallback<AVPlayer> } callback - used to return AVPlayer instance if the operation is successful; returns null otherwise. 6461847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by callback. 6561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 6661847f8eSopenharmony_ci * @crossplatform 6761847f8eSopenharmony_ci * @atomicservice 6861847f8eSopenharmony_ci * @since 12 6961847f8eSopenharmony_ci */ 7061847f8eSopenharmony_ci function createAVPlayer(callback: AsyncCallback<AVPlayer>): void; 7161847f8eSopenharmony_ci 7261847f8eSopenharmony_ci /** 7361847f8eSopenharmony_ci * Creates an AVPlayer instance. 7461847f8eSopenharmony_ci * @returns { Promise<AVPlayer> } A Promise instance used to return AVPlayer instance if the operation is successful; returns null otherwise. 7561847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by promise. 7661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 7761847f8eSopenharmony_ci * @since 9 7861847f8eSopenharmony_ci */ 7961847f8eSopenharmony_ci /** 8061847f8eSopenharmony_ci * Creates an AVPlayer instance. 8161847f8eSopenharmony_ci * @returns { Promise<AVPlayer> } A Promise instance used to return AVPlayer instance if the operation is successful; returns null otherwise. 8261847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by promise. 8361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 8461847f8eSopenharmony_ci * @atomicservice 8561847f8eSopenharmony_ci * @since 11 8661847f8eSopenharmony_ci */ 8761847f8eSopenharmony_ci /** 8861847f8eSopenharmony_ci * Creates an AVPlayer instance. 8961847f8eSopenharmony_ci * @returns { Promise<AVPlayer> } A Promise instance used to return AVPlayer instance if the operation is successful; returns null otherwise. 9061847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by promise. 9161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 9261847f8eSopenharmony_ci * @crossplatform 9361847f8eSopenharmony_ci * @atomicservice 9461847f8eSopenharmony_ci * @since 12 9561847f8eSopenharmony_ci */ 9661847f8eSopenharmony_ci function createAVPlayer(): Promise<AVPlayer>; 9761847f8eSopenharmony_ci 9861847f8eSopenharmony_ci /** 9961847f8eSopenharmony_ci * Creates an AVRecorder instance. 10061847f8eSopenharmony_ci * @param { AsyncCallback<AVRecorder> } callback - used to return AVRecorder instance if the operation is successful; returns null otherwise. 10161847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by callback. 10261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 10361847f8eSopenharmony_ci * @since 9 10461847f8eSopenharmony_ci */ 10561847f8eSopenharmony_ci /** 10661847f8eSopenharmony_ci * Creates an AVRecorder instance. 10761847f8eSopenharmony_ci * @param { AsyncCallback<AVRecorder> } callback - used to return AVRecorder instance if the operation is successful; returns null otherwise. 10861847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by callback. 10961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 11061847f8eSopenharmony_ci * @crossplatform 11161847f8eSopenharmony_ci * @since 12 11261847f8eSopenharmony_ci */ 11361847f8eSopenharmony_ci function createAVRecorder(callback: AsyncCallback<AVRecorder>): void; 11461847f8eSopenharmony_ci 11561847f8eSopenharmony_ci /** 11661847f8eSopenharmony_ci * Creates an AVRecorder instance. 11761847f8eSopenharmony_ci * @returns { Promise<AVRecorder> } A Promise instance used to return AVRecorder instance if the operation is successful; returns null otherwise. 11861847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by promise. 11961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 12061847f8eSopenharmony_ci * @since 9 12161847f8eSopenharmony_ci */ 12261847f8eSopenharmony_ci /** 12361847f8eSopenharmony_ci * Creates an AVRecorder instance. 12461847f8eSopenharmony_ci * @returns { Promise<AVRecorder> } A Promise instance used to return AVRecorder instance if the operation is successful; returns null otherwise. 12561847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by promise. 12661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 12761847f8eSopenharmony_ci * @crossplatform 12861847f8eSopenharmony_ci * @atomicservice 12961847f8eSopenharmony_ci * @since 12 13061847f8eSopenharmony_ci */ 13161847f8eSopenharmony_ci function createAVRecorder(): Promise<AVRecorder>; 13261847f8eSopenharmony_ci 13361847f8eSopenharmony_ci /** 13461847f8eSopenharmony_ci * Creates an AudioPlayer instance. 13561847f8eSopenharmony_ci * @returns { AudioPlayer } Returns an AudioPlayer instance if the operation is successful; returns null otherwise. 13661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 13761847f8eSopenharmony_ci * @since 6 13861847f8eSopenharmony_ci * @deprecated since 9 13961847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media#createAVPlayer 14061847f8eSopenharmony_ci */ 14161847f8eSopenharmony_ci function createAudioPlayer(): AudioPlayer; 14261847f8eSopenharmony_ci 14361847f8eSopenharmony_ci /** 14461847f8eSopenharmony_ci * Creates an AudioRecorder instance. 14561847f8eSopenharmony_ci * @returns { AudioRecorder } Returns an AudioRecorder instance if the operation is successful; returns null otherwise. 14661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 14761847f8eSopenharmony_ci * @since 6 14861847f8eSopenharmony_ci * @deprecated since 9 14961847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media#createAVRecorder 15061847f8eSopenharmony_ci */ 15161847f8eSopenharmony_ci function createAudioRecorder(): AudioRecorder; 15261847f8eSopenharmony_ci 15361847f8eSopenharmony_ci /** 15461847f8eSopenharmony_ci * Create MediaSource from url. 15561847f8eSopenharmony_ci * @param { string } url : The location for the media source. 15661847f8eSopenharmony_ci * @param { Record<string, string> } headers : Headers attached to network request while player request data. 15761847f8eSopenharmony_ci * @returns { MediaSource } MediaSource instance if the operation is successful; returns null otherwise. 15861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 15961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 16061847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. 16161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 16261847f8eSopenharmony_ci * @since 12 16361847f8eSopenharmony_ci */ 16461847f8eSopenharmony_ci /** 16561847f8eSopenharmony_ci * Create MediaSource from url. 16661847f8eSopenharmony_ci * @param { string } url : The location for the media source. 16761847f8eSopenharmony_ci * @param { Record<string, string> } headers : Headers attached to network request while player request data. 16861847f8eSopenharmony_ci * @returns { MediaSource } MediaSource instance if the operation is successful; returns null otherwise. 16961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 17061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 17161847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. 17261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 17361847f8eSopenharmony_ci * @atomicservice 17461847f8eSopenharmony_ci * @since 13 17561847f8eSopenharmony_ci */ 17661847f8eSopenharmony_ci function createMediaSourceWithUrl(url: string, headers?: Record<string, string>): MediaSource; 17761847f8eSopenharmony_ci 17861847f8eSopenharmony_ci /** 17961847f8eSopenharmony_ci * Creates an VideoPlayer instance. 18061847f8eSopenharmony_ci * @param { AsyncCallback<VideoPlayer> } callback - used to return AudioPlayer instance if the operation is successful; returns null otherwise. 18161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 18261847f8eSopenharmony_ci * @since 8 18361847f8eSopenharmony_ci * @deprecated since 9 18461847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media#createAVPlayer 18561847f8eSopenharmony_ci */ 18661847f8eSopenharmony_ci function createVideoPlayer(callback: AsyncCallback<VideoPlayer>): void; 18761847f8eSopenharmony_ci 18861847f8eSopenharmony_ci /** 18961847f8eSopenharmony_ci * Creates an VideoPlayer instance. 19061847f8eSopenharmony_ci * @returns { Promise<VideoPlayer> } A Promise instance used to return VideoPlayer instance if the operation is successful; returns null otherwise. 19161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 19261847f8eSopenharmony_ci * @since 8 19361847f8eSopenharmony_ci * @deprecated since 9 19461847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media#createAVPlayer 19561847f8eSopenharmony_ci */ 19661847f8eSopenharmony_ci function createVideoPlayer(): Promise<VideoPlayer>; 19761847f8eSopenharmony_ci 19861847f8eSopenharmony_ci /** 19961847f8eSopenharmony_ci * The maintenance of this interface has been stopped since version api 9. Please use AVRecorder 20061847f8eSopenharmony_ci * Creates an VideoRecorder instance. 20161847f8eSopenharmony_ci * @param { AsyncCallback<VideoRecorder> } callback - used to return AudioPlayer instance if the operation is successful; returns null otherwise. 20261847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by callback. 20361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 20461847f8eSopenharmony_ci * @systemapi 20561847f8eSopenharmony_ci * @since 9 20661847f8eSopenharmony_ci */ 20761847f8eSopenharmony_ci /** 20861847f8eSopenharmony_ci * The maintenance of this interface has been stopped since version api 9. Please use AVRecorder 20961847f8eSopenharmony_ci * Creates an VideoRecorder instance. 21061847f8eSopenharmony_ci * @param { AsyncCallback<VideoRecorder> } callback - used to return AudioPlayer instance if the operation is successful; returns null otherwise. 21161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 21261847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by callback. 21361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 21461847f8eSopenharmony_ci * @systemapi 21561847f8eSopenharmony_ci * @since 12 21661847f8eSopenharmony_ci */ 21761847f8eSopenharmony_ci function createVideoRecorder(callback: AsyncCallback<VideoRecorder>): void; 21861847f8eSopenharmony_ci 21961847f8eSopenharmony_ci /** 22061847f8eSopenharmony_ci * The maintenance of this interface has been stopped since version api 9. Please use AVRecorder 22161847f8eSopenharmony_ci * Creates an VideoRecorder instance. 22261847f8eSopenharmony_ci * @returns { Promise<VideoRecorder> } A Promise instance used to return VideoRecorder instance if the operation is successful; returns null otherwise. 22361847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by promise. 22461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 22561847f8eSopenharmony_ci * @systemapi 22661847f8eSopenharmony_ci * @since 9 22761847f8eSopenharmony_ci */ 22861847f8eSopenharmony_ci /** 22961847f8eSopenharmony_ci * The maintenance of this interface has been stopped since version api 9. Please use AVRecorder 23061847f8eSopenharmony_ci * Creates an VideoRecorder instance. 23161847f8eSopenharmony_ci * @returns { Promise<VideoRecorder> } A Promise instance used to return VideoRecorder instance if the operation is successful; returns null otherwise. 23261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 23361847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by promise. 23461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 23561847f8eSopenharmony_ci * @systemapi 23661847f8eSopenharmony_ci * @since 12 23761847f8eSopenharmony_ci */ 23861847f8eSopenharmony_ci function createVideoRecorder(): Promise<VideoRecorder>; 23961847f8eSopenharmony_ci 24061847f8eSopenharmony_ci /** 24161847f8eSopenharmony_ci * Creates a soundPool instance. 24261847f8eSopenharmony_ci * 24361847f8eSopenharmony_ci * @param {number} maxStreams The maximum number of simultaneous streams for this soundPool instance 24461847f8eSopenharmony_ci * @param {audio.AudioRendererInfo} audioRenderInfo Audio renderer information 24561847f8eSopenharmony_ci * @param {AsyncCallback<SoundPool>} callback Callback used to return soundPool instance if the operation is successful; returns null otherwise. 24661847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by callback. 24761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.SoundPool 24861847f8eSopenharmony_ci * @since 10 24961847f8eSopenharmony_ci */ 25061847f8eSopenharmony_ci function createSoundPool( 25161847f8eSopenharmony_ci maxStreams: number, 25261847f8eSopenharmony_ci audioRenderInfo: audio.AudioRendererInfo, 25361847f8eSopenharmony_ci callback: AsyncCallback<SoundPool> 25461847f8eSopenharmony_ci ): void; 25561847f8eSopenharmony_ci 25661847f8eSopenharmony_ci /** 25761847f8eSopenharmony_ci * Creates a soundPool instance. 25861847f8eSopenharmony_ci * 25961847f8eSopenharmony_ci * @param {number} maxStreams The maximum number of simultaneous streams for this soundPool instance 26061847f8eSopenharmony_ci * @param {audio.AudioRendererInfo} audioRenderInfo Audio renderer information 26161847f8eSopenharmony_ci * @returns {Promise<SoundPool>} A Promise instance used to return SoundPool instance if the operation is successful; returns null otherwise. 26261847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by promise. 26361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.SoundPool 26461847f8eSopenharmony_ci * @since 10 26561847f8eSopenharmony_ci */ 26661847f8eSopenharmony_ci function createSoundPool(maxStreams: number, audioRenderInfo: audio.AudioRendererInfo): Promise<SoundPool>; 26761847f8eSopenharmony_ci 26861847f8eSopenharmony_ci /** 26961847f8eSopenharmony_ci * Creates an AVScreenCaptureRecorder instance. 27061847f8eSopenharmony_ci * @returns { Promise<AVScreenCaptureRecorder> } A Promise instance used to return AVScreenCaptureRecorder instance if the operation is successful; 27161847f8eSopenharmony_ci * returns null otherwise. 27261847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by promise. 27361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 27461847f8eSopenharmony_ci * @since 12 27561847f8eSopenharmony_ci */ 27661847f8eSopenharmony_ci function createAVScreenCaptureRecorder(): Promise<AVScreenCaptureRecorder>; 27761847f8eSopenharmony_ci 27861847f8eSopenharmony_ci /** 27961847f8eSopenharmony_ci * Report user choice back to AVScreenCapture server 28061847f8eSopenharmony_ci * 28161847f8eSopenharmony_ci * @param {number} sessionId The AVScreenCapture server session ID. 28261847f8eSopenharmony_ci * @param {string} choice Content chosen by user. 28361847f8eSopenharmony_ci * @returns { Promise<void> } Promise used to return the result. 28461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 28561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 28661847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by promise. 28761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 28861847f8eSopenharmony_ci * @systemapi 28961847f8eSopenharmony_ci * @since 12 29061847f8eSopenharmony_ci */ 29161847f8eSopenharmony_ci function reportAVScreenCaptureUserChoice(sessionId: number, choice: string): Promise<void>; 29261847f8eSopenharmony_ci 29361847f8eSopenharmony_ci /** 29461847f8eSopenharmony_ci * Creates a AVTranscoder instance. 29561847f8eSopenharmony_ci * 29661847f8eSopenharmony_ci * @returns {Promise<AVTranscoder>} A Promise instance used to return AVTranscoder instance if the operation is successful; returns null otherwise. 29761847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Return by promise. 29861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 29961847f8eSopenharmony_ci * @since 12 30061847f8eSopenharmony_ci */ 30161847f8eSopenharmony_ci function createAVTranscoder(): Promise<AVTranscoder>; 30261847f8eSopenharmony_ci 30361847f8eSopenharmony_ci /** 30461847f8eSopenharmony_ci * Manages and plays sound. Before calling an SoundPool method, you must use createSoundPool() 30561847f8eSopenharmony_ci * to create an SoundPool instance. 30661847f8eSopenharmony_ci * 30761847f8eSopenharmony_ci * @typedef { _SoundPool } 30861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.SoundPool 30961847f8eSopenharmony_ci * @since 10 31061847f8eSopenharmony_ci */ 31161847f8eSopenharmony_ci type SoundPool = _SoundPool; 31261847f8eSopenharmony_ci 31361847f8eSopenharmony_ci /** 31461847f8eSopenharmony_ci * Describes play parameters. 31561847f8eSopenharmony_ci * 31661847f8eSopenharmony_ci * @typedef { _PlayParameters } 31761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.SoundPool 31861847f8eSopenharmony_ci * @since 10 31961847f8eSopenharmony_ci */ 32061847f8eSopenharmony_ci type PlayParameters = _PlayParameters; 32161847f8eSopenharmony_ci 32261847f8eSopenharmony_ci /** 32361847f8eSopenharmony_ci * Enumerates state change reason. 32461847f8eSopenharmony_ci * 32561847f8eSopenharmony_ci * @enum { number } 32661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 32761847f8eSopenharmony_ci * @since 9 32861847f8eSopenharmony_ci */ 32961847f8eSopenharmony_ci /** 33061847f8eSopenharmony_ci * Enumerates state change reason. 33161847f8eSopenharmony_ci * 33261847f8eSopenharmony_ci * @enum { number } 33361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 33461847f8eSopenharmony_ci * @atomicservice 33561847f8eSopenharmony_ci * @since 11 33661847f8eSopenharmony_ci */ 33761847f8eSopenharmony_ci /** 33861847f8eSopenharmony_ci * Enumerates state change reason. 33961847f8eSopenharmony_ci * 34061847f8eSopenharmony_ci * @enum { number } 34161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 34261847f8eSopenharmony_ci * @crossplatform 34361847f8eSopenharmony_ci * @atomicservice 34461847f8eSopenharmony_ci * @since 12 34561847f8eSopenharmony_ci */ 34661847f8eSopenharmony_ci enum StateChangeReason { 34761847f8eSopenharmony_ci /** 34861847f8eSopenharmony_ci * State changed by user operation. 34961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 35061847f8eSopenharmony_ci * @since 9 35161847f8eSopenharmony_ci */ 35261847f8eSopenharmony_ci /** 35361847f8eSopenharmony_ci * State changed by user operation. 35461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 35561847f8eSopenharmony_ci * @atomicservice 35661847f8eSopenharmony_ci * @since 11 35761847f8eSopenharmony_ci */ 35861847f8eSopenharmony_ci /** 35961847f8eSopenharmony_ci * State changed by user operation. 36061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 36161847f8eSopenharmony_ci * @crossplatform 36261847f8eSopenharmony_ci * @atomicservice 36361847f8eSopenharmony_ci * @since 12 36461847f8eSopenharmony_ci */ 36561847f8eSopenharmony_ci USER = 1, 36661847f8eSopenharmony_ci 36761847f8eSopenharmony_ci /** 36861847f8eSopenharmony_ci * State changed by background action. 36961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 37061847f8eSopenharmony_ci * @since 9 37161847f8eSopenharmony_ci */ 37261847f8eSopenharmony_ci /** 37361847f8eSopenharmony_ci * State changed by background action. 37461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 37561847f8eSopenharmony_ci * @atomicservice 37661847f8eSopenharmony_ci * @since 11 37761847f8eSopenharmony_ci */ 37861847f8eSopenharmony_ci /** 37961847f8eSopenharmony_ci * State changed by background action. 38061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 38161847f8eSopenharmony_ci * @crossplatform 38261847f8eSopenharmony_ci * @atomicservice 38361847f8eSopenharmony_ci * @since 12 38461847f8eSopenharmony_ci */ 38561847f8eSopenharmony_ci BACKGROUND = 2, 38661847f8eSopenharmony_ci } 38761847f8eSopenharmony_ci 38861847f8eSopenharmony_ci /** 38961847f8eSopenharmony_ci * Creates an AVMetadataExtractor instance. 39061847f8eSopenharmony_ci * @returns { Promise<AVMetadataExtractor> } A Promise instance used to return AVMetadataExtractor instance 39161847f8eSopenharmony_ci * if the operation is successful; returns null otherwise. 39261847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Returned by promise. 39361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 39461847f8eSopenharmony_ci * @since 11 39561847f8eSopenharmony_ci */ 39661847f8eSopenharmony_ci /** 39761847f8eSopenharmony_ci * Creates an AVMetadataExtractor instance. 39861847f8eSopenharmony_ci * @returns { Promise<AVMetadataExtractor> } A Promise instance used to return AVMetadataExtractor instance 39961847f8eSopenharmony_ci * if the operation is successful; returns null otherwise. 40061847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Returned by promise. 40161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 40261847f8eSopenharmony_ci * @crossplatform 40361847f8eSopenharmony_ci * @since 12 40461847f8eSopenharmony_ci */ 40561847f8eSopenharmony_ci function createAVMetadataExtractor(): Promise<AVMetadataExtractor>; 40661847f8eSopenharmony_ci 40761847f8eSopenharmony_ci /** 40861847f8eSopenharmony_ci * Creates an AVMetadataExtractor instance. 40961847f8eSopenharmony_ci * @param { AsyncCallback<AVMetadataExtractor> } callback - Callback used to return AVMetadataExtractor instance 41061847f8eSopenharmony_ci * if the operation is successful; returns null otherwise. 41161847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Returned by callback. 41261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 41361847f8eSopenharmony_ci * @since 11 41461847f8eSopenharmony_ci */ 41561847f8eSopenharmony_ci /** 41661847f8eSopenharmony_ci * Creates an AVMetadataExtractor instance. 41761847f8eSopenharmony_ci * @param { AsyncCallback<AVMetadataExtractor> } callback - Callback used to return AVMetadataExtractor instance 41861847f8eSopenharmony_ci * if the operation is successful; returns null otherwise. 41961847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Returned by callback. 42061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 42161847f8eSopenharmony_ci * @crossplatform 42261847f8eSopenharmony_ci * @since 12 42361847f8eSopenharmony_ci */ 42461847f8eSopenharmony_ci function createAVMetadataExtractor(callback: AsyncCallback<AVMetadataExtractor>): void; 42561847f8eSopenharmony_ci 42661847f8eSopenharmony_ci /** 42761847f8eSopenharmony_ci * Creates an AVImageGenerator instance. 42861847f8eSopenharmony_ci * @returns { Promise<AVImageGenerator> } A Promise instance used to return AVImageGenerator instance 42961847f8eSopenharmony_ci * if the operation is successful; returns null otherwise. 43061847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Returned by promise. 43161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 43261847f8eSopenharmony_ci * @since 12 43361847f8eSopenharmony_ci */ 43461847f8eSopenharmony_ci function createAVImageGenerator(): Promise<AVImageGenerator>; 43561847f8eSopenharmony_ci 43661847f8eSopenharmony_ci /** 43761847f8eSopenharmony_ci * Creates an AVImageGenerator instance. 43861847f8eSopenharmony_ci * @param { AsyncCallback<AVImageGenerator> } callback - Callback used to return AVImageGenerator instance 43961847f8eSopenharmony_ci * if the operation is successful; returns null otherwise. 44061847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. Returned by callback. 44161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 44261847f8eSopenharmony_ci * @since 12 44361847f8eSopenharmony_ci */ 44461847f8eSopenharmony_ci function createAVImageGenerator(callback: AsyncCallback<AVImageGenerator>): void; 44561847f8eSopenharmony_ci 44661847f8eSopenharmony_ci /** 44761847f8eSopenharmony_ci * Fetch media meta data or audio art picture from source. Before calling an AVMetadataExtractor method, 44861847f8eSopenharmony_ci * you must use createAVMetadataExtractor() to create an AVMetadataExtractor instance. 44961847f8eSopenharmony_ci * @typedef AVMetadataExtractor 45061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 45161847f8eSopenharmony_ci * @since 11 45261847f8eSopenharmony_ci */ 45361847f8eSopenharmony_ci /** 45461847f8eSopenharmony_ci * Fetch media meta data or audio art picture from source. Before calling an AVMetadataExtractor method, 45561847f8eSopenharmony_ci * you must use createAVMetadataExtractor() to create an AVMetadataExtractor instance. 45661847f8eSopenharmony_ci * @typedef AVMetadataExtractor 45761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 45861847f8eSopenharmony_ci * @crossplatform 45961847f8eSopenharmony_ci * @since 12 46061847f8eSopenharmony_ci */ 46161847f8eSopenharmony_ci interface AVMetadataExtractor { 46261847f8eSopenharmony_ci /** 46361847f8eSopenharmony_ci * Media file descriptor. 46461847f8eSopenharmony_ci * @type { ?AVFileDescriptor } 46561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 46661847f8eSopenharmony_ci * @since 11 46761847f8eSopenharmony_ci */ 46861847f8eSopenharmony_ci /** 46961847f8eSopenharmony_ci * Media file descriptor. 47061847f8eSopenharmony_ci * @type { ?AVFileDescriptor } 47161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 47261847f8eSopenharmony_ci * @crossplatform 47361847f8eSopenharmony_ci * @since 12 47461847f8eSopenharmony_ci */ 47561847f8eSopenharmony_ci fdSrc ?: AVFileDescriptor; 47661847f8eSopenharmony_ci 47761847f8eSopenharmony_ci /** 47861847f8eSopenharmony_ci * DataSource descriptor. 47961847f8eSopenharmony_ci * @type { ?AVDataSrcDescriptor } 48061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 48161847f8eSopenharmony_ci * @since 11 48261847f8eSopenharmony_ci */ 48361847f8eSopenharmony_ci /** 48461847f8eSopenharmony_ci * DataSource descriptor. 48561847f8eSopenharmony_ci * @type { ?AVDataSrcDescriptor } 48661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 48761847f8eSopenharmony_ci * @crossplatform 48861847f8eSopenharmony_ci * @since 12 48961847f8eSopenharmony_ci */ 49061847f8eSopenharmony_ci dataSrc ?: AVDataSrcDescriptor; 49161847f8eSopenharmony_ci 49261847f8eSopenharmony_ci /** 49361847f8eSopenharmony_ci * It will extract the resource to fetch media meta data info. 49461847f8eSopenharmony_ci * @param { AsyncCallback<AVMetadata> } callback - A callback instance used to return when fetchMetadata completed. 49561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by callback. 49661847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Returned by callback. 49761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 49861847f8eSopenharmony_ci * @since 11 49961847f8eSopenharmony_ci */ 50061847f8eSopenharmony_ci /** 50161847f8eSopenharmony_ci * It will extract the resource to fetch media meta data info. 50261847f8eSopenharmony_ci * @param { AsyncCallback<AVMetadata> } callback - A callback instance used to return when fetchMetadata completed. 50361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by callback. 50461847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Returned by callback. 50561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 50661847f8eSopenharmony_ci * @crossplatform 50761847f8eSopenharmony_ci * @since 12 50861847f8eSopenharmony_ci */ 50961847f8eSopenharmony_ci fetchMetadata(callback: AsyncCallback<AVMetadata>): void; 51061847f8eSopenharmony_ci 51161847f8eSopenharmony_ci /** 51261847f8eSopenharmony_ci * It will extract the resource to fetch media meta data info. 51361847f8eSopenharmony_ci * @returns { Promise<AVMetadata> } A Promise instance used to return when fetchMetadata completed. 51461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise. 51561847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. 51661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 51761847f8eSopenharmony_ci * @since 11 51861847f8eSopenharmony_ci */ 51961847f8eSopenharmony_ci /** 52061847f8eSopenharmony_ci * It will extract the resource to fetch media meta data info. 52161847f8eSopenharmony_ci * @returns { Promise<AVMetadata> } A Promise instance used to return when fetchMetadata completed. 52261847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise. 52361847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. 52461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 52561847f8eSopenharmony_ci * @crossplatform 52661847f8eSopenharmony_ci * @since 12 52761847f8eSopenharmony_ci */ 52861847f8eSopenharmony_ci fetchMetadata(): Promise<AVMetadata>; 52961847f8eSopenharmony_ci 53061847f8eSopenharmony_ci /** 53161847f8eSopenharmony_ci * It will extract the audio resource to fetch an album cover. 53261847f8eSopenharmony_ci * @param { AsyncCallback<image.PixelMap> } callback - A callback instance used 53361847f8eSopenharmony_ci * to return when fetchAlbumCover completed. 53461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 53561847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Returned by callback. 53661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 53761847f8eSopenharmony_ci * @since 11 53861847f8eSopenharmony_ci */ 53961847f8eSopenharmony_ci /** 54061847f8eSopenharmony_ci * It will extract the audio resource to fetch an album cover. 54161847f8eSopenharmony_ci * @param { AsyncCallback<image.PixelMap> } callback - A callback instance used 54261847f8eSopenharmony_ci * to return when fetchAlbumCover completed. 54361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 54461847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Returned by callback. 54561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 54661847f8eSopenharmony_ci * @crossplatform 54761847f8eSopenharmony_ci * @since 12 54861847f8eSopenharmony_ci */ 54961847f8eSopenharmony_ci fetchAlbumCover(callback: AsyncCallback<image.PixelMap>): void; 55061847f8eSopenharmony_ci 55161847f8eSopenharmony_ci /** 55261847f8eSopenharmony_ci * It will extract the audio resource to fetch an album cover. 55361847f8eSopenharmony_ci * @returns { Promise<image.PixelMap> } A Promise instance used to return when fetchAlbumCover completed. 55461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise. 55561847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. 55661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 55761847f8eSopenharmony_ci * @since 11 55861847f8eSopenharmony_ci */ 55961847f8eSopenharmony_ci /** 56061847f8eSopenharmony_ci * It will extract the audio resource to fetch an album cover. 56161847f8eSopenharmony_ci * @returns { Promise<image.PixelMap> } A Promise instance used to return when fetchAlbumCover completed. 56261847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise. 56361847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. 56461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 56561847f8eSopenharmony_ci * @crossplatform 56661847f8eSopenharmony_ci * @since 12 56761847f8eSopenharmony_ci */ 56861847f8eSopenharmony_ci fetchAlbumCover(): Promise<image.PixelMap>; 56961847f8eSopenharmony_ci 57061847f8eSopenharmony_ci /** 57161847f8eSopenharmony_ci * Get timestamp according to frame index. 57261847f8eSopenharmony_ci * @param { number } index - Index of the frame. 57361847f8eSopenharmony_ci * @returns { Promise<number> } A Promise instance used to return frame timestamp, in microseconds. 57461847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Return by promise. 57561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise. 57661847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. 57761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 57861847f8eSopenharmony_ci * @systemapi 57961847f8eSopenharmony_ci * @since 12 58061847f8eSopenharmony_ci */ 58161847f8eSopenharmony_ci getTimeByFrameIndex(index: number): Promise<number>; 58261847f8eSopenharmony_ci 58361847f8eSopenharmony_ci /** 58461847f8eSopenharmony_ci * Get frame index according to the given timestamp. 58561847f8eSopenharmony_ci * @param { number } timeUs - Timestamp of the frame, in microseconds. 58661847f8eSopenharmony_ci * @returns { Promise<number> } A Promise instance used to return frame index. 58761847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Return by promise. 58861847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise. 58961847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. 59061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 59161847f8eSopenharmony_ci * @systemapi 59261847f8eSopenharmony_ci * @since 12 59361847f8eSopenharmony_ci */ 59461847f8eSopenharmony_ci getFrameIndexByTime(timeUs: number): Promise<number>; 59561847f8eSopenharmony_ci 59661847f8eSopenharmony_ci /** 59761847f8eSopenharmony_ci * Release resources used for AVMetadataExtractor. 59861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when release completed. 59961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by callback. 60061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 60161847f8eSopenharmony_ci * @since 11 60261847f8eSopenharmony_ci */ 60361847f8eSopenharmony_ci /** 60461847f8eSopenharmony_ci * Release resources used for AVMetadataExtractor. 60561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when release completed. 60661847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by callback. 60761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 60861847f8eSopenharmony_ci * @crossplatform 60961847f8eSopenharmony_ci * @since 12 61061847f8eSopenharmony_ci */ 61161847f8eSopenharmony_ci release(callback: AsyncCallback<void>): void; 61261847f8eSopenharmony_ci 61361847f8eSopenharmony_ci /** 61461847f8eSopenharmony_ci * Release resources used for AVMetadataExtractor. 61561847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when release completed. 61661847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise. 61761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 61861847f8eSopenharmony_ci * @since 11 61961847f8eSopenharmony_ci */ 62061847f8eSopenharmony_ci /** 62161847f8eSopenharmony_ci * Release resources used for AVMetadataExtractor. 62261847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when release completed. 62361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise. 62461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 62561847f8eSopenharmony_ci * @crossplatform 62661847f8eSopenharmony_ci * @since 12 62761847f8eSopenharmony_ci */ 62861847f8eSopenharmony_ci release(): Promise<void>; 62961847f8eSopenharmony_ci } 63061847f8eSopenharmony_ci 63161847f8eSopenharmony_ci /** 63261847f8eSopenharmony_ci * Provides the container definition for media meta data. 63361847f8eSopenharmony_ci * @typedef AVMetadata 63461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 63561847f8eSopenharmony_ci * @since 11 63661847f8eSopenharmony_ci */ 63761847f8eSopenharmony_ci /** 63861847f8eSopenharmony_ci * Provides the container definition for media meta data. 63961847f8eSopenharmony_ci * @typedef AVMetadata 64061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 64161847f8eSopenharmony_ci * @crossplatform 64261847f8eSopenharmony_ci * @since 12 64361847f8eSopenharmony_ci */ 64461847f8eSopenharmony_ci interface AVMetadata { 64561847f8eSopenharmony_ci /** 64661847f8eSopenharmony_ci * The metadata to retrieve the information about the album title 64761847f8eSopenharmony_ci * of the media source. 64861847f8eSopenharmony_ci * @type { ?string } 64961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 65061847f8eSopenharmony_ci * @since 11 65161847f8eSopenharmony_ci */ 65261847f8eSopenharmony_ci /** 65361847f8eSopenharmony_ci * The metadata to retrieve the information about the album title 65461847f8eSopenharmony_ci * of the media source. This field is readonly in current version. 65561847f8eSopenharmony_ci * @type { ?string } 65661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 65761847f8eSopenharmony_ci * @crossplatform 65861847f8eSopenharmony_ci * @since 12 65961847f8eSopenharmony_ci */ 66061847f8eSopenharmony_ci album?: string; 66161847f8eSopenharmony_ci 66261847f8eSopenharmony_ci /** 66361847f8eSopenharmony_ci * The metadata to retrieve the information about the performer or 66461847f8eSopenharmony_ci * artist associated with the media source. 66561847f8eSopenharmony_ci * @type { ?string } 66661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 66761847f8eSopenharmony_ci * @since 11 66861847f8eSopenharmony_ci */ 66961847f8eSopenharmony_ci /** 67061847f8eSopenharmony_ci * The metadata to retrieve the information about the performer or 67161847f8eSopenharmony_ci * artist associated with the media source. This field is readonly in current version. 67261847f8eSopenharmony_ci * @type { ?string } 67361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 67461847f8eSopenharmony_ci * @crossplatform 67561847f8eSopenharmony_ci * @since 12 67661847f8eSopenharmony_ci */ 67761847f8eSopenharmony_ci albumArtist?: string; 67861847f8eSopenharmony_ci 67961847f8eSopenharmony_ci /** 68061847f8eSopenharmony_ci * The metadata to retrieve the information about the artist of 68161847f8eSopenharmony_ci * the media source. 68261847f8eSopenharmony_ci * @type { ?string } 68361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 68461847f8eSopenharmony_ci * @since 11 68561847f8eSopenharmony_ci */ 68661847f8eSopenharmony_ci /** 68761847f8eSopenharmony_ci * The metadata to retrieve the information about the artist of 68861847f8eSopenharmony_ci * the media source. This field is readonly in current version. 68961847f8eSopenharmony_ci * @type { ?string } 69061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 69161847f8eSopenharmony_ci * @crossplatform 69261847f8eSopenharmony_ci * @since 12 69361847f8eSopenharmony_ci */ 69461847f8eSopenharmony_ci artist?: string; 69561847f8eSopenharmony_ci 69661847f8eSopenharmony_ci /** 69761847f8eSopenharmony_ci * The metadata to retrieve the information about the author of 69861847f8eSopenharmony_ci * the media source. 69961847f8eSopenharmony_ci * @type { ?string } 70061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 70161847f8eSopenharmony_ci * @since 11 70261847f8eSopenharmony_ci */ 70361847f8eSopenharmony_ci /** 70461847f8eSopenharmony_ci * The metadata to retrieve the information about the author of 70561847f8eSopenharmony_ci * the media source. This field is readonly in current version. 70661847f8eSopenharmony_ci * @type { ?string } 70761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 70861847f8eSopenharmony_ci * @crossplatform 70961847f8eSopenharmony_ci * @since 12 71061847f8eSopenharmony_ci */ 71161847f8eSopenharmony_ci author?: string; 71261847f8eSopenharmony_ci 71361847f8eSopenharmony_ci /** 71461847f8eSopenharmony_ci * The metadata to retrieve the information about the created time of 71561847f8eSopenharmony_ci * the media source. 71661847f8eSopenharmony_ci * @type { ?string } 71761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 71861847f8eSopenharmony_ci * @since 11 71961847f8eSopenharmony_ci */ 72061847f8eSopenharmony_ci /** 72161847f8eSopenharmony_ci * The metadata to retrieve the information about the created time of 72261847f8eSopenharmony_ci * the media source. This field is readonly in current version. 72361847f8eSopenharmony_ci * @type { ?string } 72461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 72561847f8eSopenharmony_ci * @crossplatform 72661847f8eSopenharmony_ci * @since 12 72761847f8eSopenharmony_ci */ 72861847f8eSopenharmony_ci dateTime?: string; 72961847f8eSopenharmony_ci 73061847f8eSopenharmony_ci /** 73161847f8eSopenharmony_ci * The metadata to retrieve the information about the created or modified time 73261847f8eSopenharmony_ci * with the specific date format of the media source. 73361847f8eSopenharmony_ci * @type { ?string } 73461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 73561847f8eSopenharmony_ci * @since 11 73661847f8eSopenharmony_ci */ 73761847f8eSopenharmony_ci /** 73861847f8eSopenharmony_ci * The metadata to retrieve the information about the created or modified time 73961847f8eSopenharmony_ci * with the specific date format of the media source. This field is readonly in current version. 74061847f8eSopenharmony_ci * @type { ?string } 74161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 74261847f8eSopenharmony_ci * @crossplatform 74361847f8eSopenharmony_ci * @since 12 74461847f8eSopenharmony_ci */ 74561847f8eSopenharmony_ci dateTimeFormat?: string; 74661847f8eSopenharmony_ci 74761847f8eSopenharmony_ci /** 74861847f8eSopenharmony_ci * The metadata to retrieve the information about the composer of 74961847f8eSopenharmony_ci * the media source. 75061847f8eSopenharmony_ci * @type { ?string } 75161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 75261847f8eSopenharmony_ci * @since 11 75361847f8eSopenharmony_ci */ 75461847f8eSopenharmony_ci /** 75561847f8eSopenharmony_ci * The metadata to retrieve the information about the composer of 75661847f8eSopenharmony_ci * the media source. This field is readonly in current version. 75761847f8eSopenharmony_ci * @type { ?string } 75861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 75961847f8eSopenharmony_ci * @crossplatform 76061847f8eSopenharmony_ci * @since 12 76161847f8eSopenharmony_ci */ 76261847f8eSopenharmony_ci composer?: string; 76361847f8eSopenharmony_ci 76461847f8eSopenharmony_ci /** 76561847f8eSopenharmony_ci * The metadata to retrieve the playback duration of the media source. 76661847f8eSopenharmony_ci * @type { ?string } 76761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 76861847f8eSopenharmony_ci * @since 11 76961847f8eSopenharmony_ci */ 77061847f8eSopenharmony_ci /** 77161847f8eSopenharmony_ci * The metadata to retrieve the playback duration of the media source. This field is readonly in current version. 77261847f8eSopenharmony_ci * @type { ?string } 77361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 77461847f8eSopenharmony_ci * @crossplatform 77561847f8eSopenharmony_ci * @since 12 77661847f8eSopenharmony_ci */ 77761847f8eSopenharmony_ci duration?: string; 77861847f8eSopenharmony_ci 77961847f8eSopenharmony_ci /** 78061847f8eSopenharmony_ci * The metadata to retrieve the content type or genre of the data 78161847f8eSopenharmony_ci * source. 78261847f8eSopenharmony_ci * @type { ?string } 78361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 78461847f8eSopenharmony_ci * @since 11 78561847f8eSopenharmony_ci */ 78661847f8eSopenharmony_ci /** 78761847f8eSopenharmony_ci * The metadata to retrieve the content type or genre of the data 78861847f8eSopenharmony_ci * source. 78961847f8eSopenharmony_ci * @type { ?string } 79061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 79161847f8eSopenharmony_ci * @crossplatform 79261847f8eSopenharmony_ci * @since 12 79361847f8eSopenharmony_ci */ 79461847f8eSopenharmony_ci genre?: string; 79561847f8eSopenharmony_ci 79661847f8eSopenharmony_ci /** 79761847f8eSopenharmony_ci * If this value exists the media contains audio content. 79861847f8eSopenharmony_ci * @type { ?string } 79961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 80061847f8eSopenharmony_ci * @since 11 80161847f8eSopenharmony_ci */ 80261847f8eSopenharmony_ci /** 80361847f8eSopenharmony_ci * If this value exists the media contains audio content. This field is readonly in current version. 80461847f8eSopenharmony_ci * @type { ?string } 80561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 80661847f8eSopenharmony_ci * @crossplatform 80761847f8eSopenharmony_ci * @since 12 80861847f8eSopenharmony_ci */ 80961847f8eSopenharmony_ci hasAudio?: string; 81061847f8eSopenharmony_ci 81161847f8eSopenharmony_ci /** 81261847f8eSopenharmony_ci * If this value exists the media contains video content. 81361847f8eSopenharmony_ci * @type { ?string } 81461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 81561847f8eSopenharmony_ci * @since 11 81661847f8eSopenharmony_ci */ 81761847f8eSopenharmony_ci /** 81861847f8eSopenharmony_ci * If this value exists the media contains video content. This field is readonly in current version. 81961847f8eSopenharmony_ci * @type { ?string } 82061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 82161847f8eSopenharmony_ci * @crossplatform 82261847f8eSopenharmony_ci * @since 12 82361847f8eSopenharmony_ci */ 82461847f8eSopenharmony_ci hasVideo?: string; 82561847f8eSopenharmony_ci 82661847f8eSopenharmony_ci /** 82761847f8eSopenharmony_ci * The metadata to retrieve the mime type of the media source. Some 82861847f8eSopenharmony_ci * example mime types include: "video/mp4", "audio/mp4", "audio/amr-wb", 82961847f8eSopenharmony_ci * @type { ?string } 83061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 83161847f8eSopenharmony_ci * @since 11 83261847f8eSopenharmony_ci */ 83361847f8eSopenharmony_ci /** 83461847f8eSopenharmony_ci * The metadata to retrieve the mime type of the media source. Some 83561847f8eSopenharmony_ci * example mime types include: "video/mp4", "audio/mp4", "audio/amr-wb". This field is readonly in current version. 83661847f8eSopenharmony_ci * @type { ?string } 83761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 83861847f8eSopenharmony_ci * @crossplatform 83961847f8eSopenharmony_ci * @since 12 84061847f8eSopenharmony_ci */ 84161847f8eSopenharmony_ci mimeType?: string; 84261847f8eSopenharmony_ci 84361847f8eSopenharmony_ci /** 84461847f8eSopenharmony_ci * The metadata to retrieve the number of tracks, such as audio, video, 84561847f8eSopenharmony_ci * text, in the media source, such as a mp4 or 3gpp file. 84661847f8eSopenharmony_ci * @type { ?string } 84761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 84861847f8eSopenharmony_ci * @since 11 84961847f8eSopenharmony_ci */ 85061847f8eSopenharmony_ci /** 85161847f8eSopenharmony_ci * The metadata to retrieve the number of tracks, such as audio, video, 85261847f8eSopenharmony_ci * text, in the media source, such as a mp4 or 3gpp file. This field is readonly in current version. 85361847f8eSopenharmony_ci * @type { ?string } 85461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 85561847f8eSopenharmony_ci * @crossplatform 85661847f8eSopenharmony_ci * @since 12 85761847f8eSopenharmony_ci */ 85861847f8eSopenharmony_ci trackCount?: string; 85961847f8eSopenharmony_ci 86061847f8eSopenharmony_ci /** 86161847f8eSopenharmony_ci * It is the audio sample rate, if available. 86261847f8eSopenharmony_ci * @type { ?string } 86361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 86461847f8eSopenharmony_ci * @since 11 86561847f8eSopenharmony_ci */ 86661847f8eSopenharmony_ci /** 86761847f8eSopenharmony_ci * It is the audio sample rate, if available. This field is readonly in current version. 86861847f8eSopenharmony_ci * @type { ?string } 86961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 87061847f8eSopenharmony_ci * @crossplatform 87161847f8eSopenharmony_ci * @since 12 87261847f8eSopenharmony_ci */ 87361847f8eSopenharmony_ci sampleRate?: string; 87461847f8eSopenharmony_ci 87561847f8eSopenharmony_ci /** 87661847f8eSopenharmony_ci * The metadata to retrieve the media source title. 87761847f8eSopenharmony_ci * @type { ?string } 87861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 87961847f8eSopenharmony_ci * @since 11 88061847f8eSopenharmony_ci */ 88161847f8eSopenharmony_ci /** 88261847f8eSopenharmony_ci * The metadata to retrieve the media source title. This field is readonly in current version. 88361847f8eSopenharmony_ci * @type { ?string } 88461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 88561847f8eSopenharmony_ci * @crossplatform 88661847f8eSopenharmony_ci * @since 12 88761847f8eSopenharmony_ci */ 88861847f8eSopenharmony_ci title?: string; 88961847f8eSopenharmony_ci 89061847f8eSopenharmony_ci /** 89161847f8eSopenharmony_ci * If the media contains video, this key retrieves its height. 89261847f8eSopenharmony_ci * @type { ?string } 89361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 89461847f8eSopenharmony_ci * @since 11 89561847f8eSopenharmony_ci */ 89661847f8eSopenharmony_ci /** 89761847f8eSopenharmony_ci * If the media contains video, this key retrieves its height. This field is readonly in current version. 89861847f8eSopenharmony_ci * @type { ?string } 89961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 90061847f8eSopenharmony_ci * @crossplatform 90161847f8eSopenharmony_ci * @since 12 90261847f8eSopenharmony_ci */ 90361847f8eSopenharmony_ci videoHeight?: string; 90461847f8eSopenharmony_ci 90561847f8eSopenharmony_ci /** 90661847f8eSopenharmony_ci * If the media contains video, this key retrieves its width. 90761847f8eSopenharmony_ci * @type { ?string } 90861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 90961847f8eSopenharmony_ci * @since 11 91061847f8eSopenharmony_ci */ 91161847f8eSopenharmony_ci /** 91261847f8eSopenharmony_ci * If the media contains video, this key retrieves its width. This field is readonly in current version. 91361847f8eSopenharmony_ci * @type { ?string } 91461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 91561847f8eSopenharmony_ci * @crossplatform 91661847f8eSopenharmony_ci * @since 12 91761847f8eSopenharmony_ci */ 91861847f8eSopenharmony_ci videoWidth?: string; 91961847f8eSopenharmony_ci 92061847f8eSopenharmony_ci /** 92161847f8eSopenharmony_ci * The metadata to retrieve the information about the video 92261847f8eSopenharmony_ci * orientation. 92361847f8eSopenharmony_ci * @type { ?string } 92461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 92561847f8eSopenharmony_ci * @since 11 92661847f8eSopenharmony_ci */ 92761847f8eSopenharmony_ci /** 92861847f8eSopenharmony_ci * The metadata to retrieve the information about the video 92961847f8eSopenharmony_ci * orientation. 93061847f8eSopenharmony_ci * @type { ?string } 93161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 93261847f8eSopenharmony_ci * @crossplatform 93361847f8eSopenharmony_ci * @since 12 93461847f8eSopenharmony_ci */ 93561847f8eSopenharmony_ci videoOrientation?: string; 93661847f8eSopenharmony_ci 93761847f8eSopenharmony_ci /** 93861847f8eSopenharmony_ci * This value exists if the video is HDR video.This field is readonly in current version. 93961847f8eSopenharmony_ci * @type { ?HdrType } 94061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 94161847f8eSopenharmony_ci * @crossplatform 94261847f8eSopenharmony_ci * @since 12 94361847f8eSopenharmony_ci */ 94461847f8eSopenharmony_ci hdrType?: HdrType; 94561847f8eSopenharmony_ci 94661847f8eSopenharmony_ci /** 94761847f8eSopenharmony_ci * The geographical location info of the video. 94861847f8eSopenharmony_ci * @type { ?Location } 94961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 95061847f8eSopenharmony_ci * @since 12 95161847f8eSopenharmony_ci */ 95261847f8eSopenharmony_ci location?: Location; 95361847f8eSopenharmony_ci 95461847f8eSopenharmony_ci /** 95561847f8eSopenharmony_ci * Custom parameter key-value map read from moov.meta.list. 95661847f8eSopenharmony_ci * @type { ?Record<string, string> } 95761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor 95861847f8eSopenharmony_ci * @since 12 95961847f8eSopenharmony_ci */ 96061847f8eSopenharmony_ci customInfo?: Record<string, string>; 96161847f8eSopenharmony_ci } 96261847f8eSopenharmony_ci 96361847f8eSopenharmony_ci /** 96461847f8eSopenharmony_ci * Enumerates options about the HDR Type of the video. 96561847f8eSopenharmony_ci * @enum { number } 96661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 96761847f8eSopenharmony_ci * @crossplatform 96861847f8eSopenharmony_ci * @since 12 96961847f8eSopenharmony_ci */ 97061847f8eSopenharmony_ci enum HdrType { 97161847f8eSopenharmony_ci /** 97261847f8eSopenharmony_ci * This option is used to mark none HDR type. 97361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 97461847f8eSopenharmony_ci * @crossplatform 97561847f8eSopenharmony_ci * @since 12 97661847f8eSopenharmony_ci */ 97761847f8eSopenharmony_ci AV_HDR_TYPE_NONE = 0, 97861847f8eSopenharmony_ci 97961847f8eSopenharmony_ci /** 98061847f8eSopenharmony_ci * This option is used to mark HDR Vivid type. 98161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 98261847f8eSopenharmony_ci * @crossplatform 98361847f8eSopenharmony_ci * @since 12 98461847f8eSopenharmony_ci */ 98561847f8eSopenharmony_ci AV_HDR_TYPE_VIVID = 1, 98661847f8eSopenharmony_ci } 98761847f8eSopenharmony_ci 98861847f8eSopenharmony_ci /** 98961847f8eSopenharmony_ci * Generate an image from a video resource with the specific time. Before calling an AVImageGenerator method, 99061847f8eSopenharmony_ci * you must use createAVImageGenerator() to create an AVImageGenerator instance. 99161847f8eSopenharmony_ci * @typedef AVImageGenerator 99261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 99361847f8eSopenharmony_ci * @since 12 99461847f8eSopenharmony_ci */ 99561847f8eSopenharmony_ci interface AVImageGenerator { 99661847f8eSopenharmony_ci /** 99761847f8eSopenharmony_ci * Media file descriptor. 99861847f8eSopenharmony_ci * @type { ?AVFileDescriptor } 99961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 100061847f8eSopenharmony_ci * @since 12 100161847f8eSopenharmony_ci */ 100261847f8eSopenharmony_ci fdSrc ?: AVFileDescriptor; 100361847f8eSopenharmony_ci 100461847f8eSopenharmony_ci /** 100561847f8eSopenharmony_ci * It will fetch a picture at @timeUs from the given video resource. 100661847f8eSopenharmony_ci * @param { number } timeUs - The time expected to fetch picture from the video resource. 100761847f8eSopenharmony_ci * The unit is microsecond(us). 100861847f8eSopenharmony_ci * @param { AVImageQueryOptions } options - The time options about the relationship 100961847f8eSopenharmony_ci * between the given timeUs and a key frame, see @AVImageQueryOptions . 101061847f8eSopenharmony_ci * @param { PixelMapParams } param - The output pixel map format params, see @PixelMapParams . 101161847f8eSopenharmony_ci * @param { AsyncCallback<image.PixelMap> } callback - A callback instance used 101261847f8eSopenharmony_ci * to return when fetchFrameByTime completed. 101361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by callback. 101461847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Returned by callback. 101561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 101661847f8eSopenharmony_ci * @since 12 101761847f8eSopenharmony_ci */ 101861847f8eSopenharmony_ci fetchFrameByTime(timeUs: number, options: AVImageQueryOptions, param: PixelMapParams, 101961847f8eSopenharmony_ci callback: AsyncCallback<image.PixelMap>): void; 102061847f8eSopenharmony_ci 102161847f8eSopenharmony_ci /** 102261847f8eSopenharmony_ci * It will decode the given video resource. Then fetch a picture 102361847f8eSopenharmony_ci * at @timeUs according the given @options and @param . 102461847f8eSopenharmony_ci * @param { number } timeUs - The time expected to fetch picture from the video resource. 102561847f8eSopenharmony_ci * The unit is microsecond(us). 102661847f8eSopenharmony_ci * @param { AVImageQueryOptions } options - The time options about the relationship 102761847f8eSopenharmony_ci * between the given timeUs and a key frame, see @AVImageQueryOptions . 102861847f8eSopenharmony_ci * @param { PixelMapParams } param - The output pixel map format params, see @PixelMapParams . 102961847f8eSopenharmony_ci * @returns { Promise<image.PixelMap> } A Promise instance used to return the pixel map 103061847f8eSopenharmony_ci * when fetchFrameByTime completed. 103161847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise. 103261847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. 103361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 103461847f8eSopenharmony_ci * @since 12 103561847f8eSopenharmony_ci */ 103661847f8eSopenharmony_ci fetchFrameByTime(timeUs: number, options: AVImageQueryOptions, param: PixelMapParams): Promise<image.PixelMap>; 103761847f8eSopenharmony_ci 103861847f8eSopenharmony_ci /** 103961847f8eSopenharmony_ci * Release resources used for AVImageGenerator. 104061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when release completed. 104161847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by callback. 104261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 104361847f8eSopenharmony_ci * @since 12 104461847f8eSopenharmony_ci */ 104561847f8eSopenharmony_ci release(callback: AsyncCallback<void>): void; 104661847f8eSopenharmony_ci 104761847f8eSopenharmony_ci /** 104861847f8eSopenharmony_ci * Release resources used for AVImageGenerator. 104961847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when release completed. 105061847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise. 105161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 105261847f8eSopenharmony_ci * @since 12 105361847f8eSopenharmony_ci */ 105461847f8eSopenharmony_ci release(): Promise<void>; 105561847f8eSopenharmony_ci } 105661847f8eSopenharmony_ci 105761847f8eSopenharmony_ci /** 105861847f8eSopenharmony_ci * Enumerates options about the relationship between the given timeUs and a key frame. 105961847f8eSopenharmony_ci * @enum { number } 106061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 106161847f8eSopenharmony_ci * @since 12 106261847f8eSopenharmony_ci */ 106361847f8eSopenharmony_ci enum AVImageQueryOptions { 106461847f8eSopenharmony_ci /** 106561847f8eSopenharmony_ci * This option is used to fetch a key frame from the given media 106661847f8eSopenharmony_ci * resource that is located right after or at the given time. 106761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 106861847f8eSopenharmony_ci * @since 12 106961847f8eSopenharmony_ci */ 107061847f8eSopenharmony_ci AV_IMAGE_QUERY_NEXT_SYNC, 107161847f8eSopenharmony_ci 107261847f8eSopenharmony_ci /** 107361847f8eSopenharmony_ci * This option is used to fetch a key frame from the given media 107461847f8eSopenharmony_ci * resource that is located right before or at the given time. 107561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 107661847f8eSopenharmony_ci * @since 12 107761847f8eSopenharmony_ci */ 107861847f8eSopenharmony_ci AV_IMAGE_QUERY_PREVIOUS_SYNC, 107961847f8eSopenharmony_ci 108061847f8eSopenharmony_ci /** 108161847f8eSopenharmony_ci * This option is used to fetch a key frame from the given media 108261847f8eSopenharmony_ci * resource that is located closest to or at the given time. 108361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 108461847f8eSopenharmony_ci * @since 12 108561847f8eSopenharmony_ci */ 108661847f8eSopenharmony_ci AV_IMAGE_QUERY_CLOSEST_SYNC, 108761847f8eSopenharmony_ci 108861847f8eSopenharmony_ci /** 108961847f8eSopenharmony_ci * This option is used to fetch a frame (maybe not keyframe) from 109061847f8eSopenharmony_ci * the given media resource that is located closest to or at the given time. 109161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 109261847f8eSopenharmony_ci * @since 12 109361847f8eSopenharmony_ci */ 109461847f8eSopenharmony_ci AV_IMAGE_QUERY_CLOSEST, 109561847f8eSopenharmony_ci } 109661847f8eSopenharmony_ci 109761847f8eSopenharmony_ci /** 109861847f8eSopenharmony_ci * Expected pixel map format for the fetched image from video resource. 109961847f8eSopenharmony_ci * @typedef PixelMapParams 110061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 110161847f8eSopenharmony_ci * @since 12 110261847f8eSopenharmony_ci */ 110361847f8eSopenharmony_ci interface PixelMapParams { 110461847f8eSopenharmony_ci /** 110561847f8eSopenharmony_ci * Expected pixelmap's width, -1 means to keep consistent with the 110661847f8eSopenharmony_ci * original dimensions of the given video resource. 110761847f8eSopenharmony_ci * @type { ?number } 110861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 110961847f8eSopenharmony_ci * @since 12 111061847f8eSopenharmony_ci */ 111161847f8eSopenharmony_ci width?: number; 111261847f8eSopenharmony_ci 111361847f8eSopenharmony_ci /** 111461847f8eSopenharmony_ci * Expected pixelmap's width, -1 means to keep consistent with the 111561847f8eSopenharmony_ci * original dimensions of the given video resource. 111661847f8eSopenharmony_ci * @type { ?number } 111761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 111861847f8eSopenharmony_ci * @since 12 111961847f8eSopenharmony_ci */ 112061847f8eSopenharmony_ci height?: number; 112161847f8eSopenharmony_ci 112261847f8eSopenharmony_ci /** 112361847f8eSopenharmony_ci * Expected pixelmap's color format, see {@link PixelFormat}. 112461847f8eSopenharmony_ci * @type { ?PixelFormat } 112561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 112661847f8eSopenharmony_ci * @systemapi 112761847f8eSopenharmony_ci * @since 11 112861847f8eSopenharmony_ci */ 112961847f8eSopenharmony_ci colorFormat?: PixelFormat; 113061847f8eSopenharmony_ci } 113161847f8eSopenharmony_ci 113261847f8eSopenharmony_ci /** 113361847f8eSopenharmony_ci * Enumerates options about the expected color options for the fetched image. 113461847f8eSopenharmony_ci * @enum { number } 113561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 113661847f8eSopenharmony_ci * @systemapi 113761847f8eSopenharmony_ci * @since 11 113861847f8eSopenharmony_ci */ 113961847f8eSopenharmony_ci enum PixelFormat { 114061847f8eSopenharmony_ci /** 114161847f8eSopenharmony_ci * RGB_565 options. 114261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 114361847f8eSopenharmony_ci * @systemapi 114461847f8eSopenharmony_ci * @since 11 114561847f8eSopenharmony_ci */ 114661847f8eSopenharmony_ci RGB_565 = 2, 114761847f8eSopenharmony_ci 114861847f8eSopenharmony_ci /** 114961847f8eSopenharmony_ci * RGBA_8888 options. 115061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 115161847f8eSopenharmony_ci * @systemapi 115261847f8eSopenharmony_ci * @since 11 115361847f8eSopenharmony_ci */ 115461847f8eSopenharmony_ci RGBA_8888 = 3, 115561847f8eSopenharmony_ci 115661847f8eSopenharmony_ci /** 115761847f8eSopenharmony_ci * RGB_888 options. 115861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVImageGenerator 115961847f8eSopenharmony_ci * @systemapi 116061847f8eSopenharmony_ci * @since 11 116161847f8eSopenharmony_ci */ 116261847f8eSopenharmony_ci RGB_888 = 5, 116361847f8eSopenharmony_ci } 116461847f8eSopenharmony_ci 116561847f8eSopenharmony_ci /** 116661847f8eSopenharmony_ci * Enumerates ErrorCode types, return in BusinessError::code. 116761847f8eSopenharmony_ci * 116861847f8eSopenharmony_ci * @enum { number } 116961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 117061847f8eSopenharmony_ci * @since 9 117161847f8eSopenharmony_ci */ 117261847f8eSopenharmony_ci /** 117361847f8eSopenharmony_ci * Enumerates ErrorCode types, return in BusinessError::code. 117461847f8eSopenharmony_ci * 117561847f8eSopenharmony_ci * @enum { number } 117661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 117761847f8eSopenharmony_ci * @atomicservice 117861847f8eSopenharmony_ci * @since 11 117961847f8eSopenharmony_ci */ 118061847f8eSopenharmony_ci /** 118161847f8eSopenharmony_ci * Enumerates ErrorCode types, return in BusinessError::code. 118261847f8eSopenharmony_ci * 118361847f8eSopenharmony_ci * @enum { number } 118461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 118561847f8eSopenharmony_ci * @crossplatform 118661847f8eSopenharmony_ci * @atomicservice 118761847f8eSopenharmony_ci * @since 12 118861847f8eSopenharmony_ci */ 118961847f8eSopenharmony_ci enum AVErrorCode { 119061847f8eSopenharmony_ci /** 119161847f8eSopenharmony_ci * Operation success. 119261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 119361847f8eSopenharmony_ci * @since 9 119461847f8eSopenharmony_ci */ 119561847f8eSopenharmony_ci /** 119661847f8eSopenharmony_ci * Operation success. 119761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 119861847f8eSopenharmony_ci * @atomicservice 119961847f8eSopenharmony_ci * @since 11 120061847f8eSopenharmony_ci */ 120161847f8eSopenharmony_ci /** 120261847f8eSopenharmony_ci * Operation success. 120361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 120461847f8eSopenharmony_ci * @crossplatform 120561847f8eSopenharmony_ci * @atomicservice 120661847f8eSopenharmony_ci * @since 12 120761847f8eSopenharmony_ci */ 120861847f8eSopenharmony_ci AVERR_OK = 0, 120961847f8eSopenharmony_ci 121061847f8eSopenharmony_ci /** 121161847f8eSopenharmony_ci * Permission denied. 121261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 121361847f8eSopenharmony_ci * @since 9 121461847f8eSopenharmony_ci */ 121561847f8eSopenharmony_ci /** 121661847f8eSopenharmony_ci * Permission denied. 121761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 121861847f8eSopenharmony_ci * @atomicservice 121961847f8eSopenharmony_ci * @since 11 122061847f8eSopenharmony_ci */ 122161847f8eSopenharmony_ci /** 122261847f8eSopenharmony_ci * Permission denied. 122361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 122461847f8eSopenharmony_ci * @crossplatform 122561847f8eSopenharmony_ci * @atomicservice 122661847f8eSopenharmony_ci * @since 12 122761847f8eSopenharmony_ci */ 122861847f8eSopenharmony_ci AVERR_NO_PERMISSION = 201, 122961847f8eSopenharmony_ci 123061847f8eSopenharmony_ci /** 123161847f8eSopenharmony_ci * Invalid parameter. 123261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 123361847f8eSopenharmony_ci * @since 9 123461847f8eSopenharmony_ci */ 123561847f8eSopenharmony_ci /** 123661847f8eSopenharmony_ci * Invalid parameter. 123761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 123861847f8eSopenharmony_ci * @atomicservice 123961847f8eSopenharmony_ci * @since 11 124061847f8eSopenharmony_ci */ 124161847f8eSopenharmony_ci /** 124261847f8eSopenharmony_ci * Invalid parameter. 124361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 124461847f8eSopenharmony_ci * @crossplatform 124561847f8eSopenharmony_ci * @atomicservice 124661847f8eSopenharmony_ci * @since 12 124761847f8eSopenharmony_ci */ 124861847f8eSopenharmony_ci AVERR_INVALID_PARAMETER = 401, 124961847f8eSopenharmony_ci 125061847f8eSopenharmony_ci /** 125161847f8eSopenharmony_ci * The api is not supported in the current version. 125261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 125361847f8eSopenharmony_ci * @since 9 125461847f8eSopenharmony_ci */ 125561847f8eSopenharmony_ci /** 125661847f8eSopenharmony_ci * The api is not supported in the current version. 125761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 125861847f8eSopenharmony_ci * @atomicservice 125961847f8eSopenharmony_ci * @since 11 126061847f8eSopenharmony_ci */ 126161847f8eSopenharmony_ci /** 126261847f8eSopenharmony_ci * The api is not supported in the current version. 126361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 126461847f8eSopenharmony_ci * @crossplatform 126561847f8eSopenharmony_ci * @atomicservice 126661847f8eSopenharmony_ci * @since 12 126761847f8eSopenharmony_ci */ 126861847f8eSopenharmony_ci AVERR_UNSUPPORT_CAPABILITY = 801, 126961847f8eSopenharmony_ci 127061847f8eSopenharmony_ci /** 127161847f8eSopenharmony_ci * The system memory is insufficient or the number of services reaches the upper limit. 127261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 127361847f8eSopenharmony_ci * @since 9 127461847f8eSopenharmony_ci */ 127561847f8eSopenharmony_ci /** 127661847f8eSopenharmony_ci * The system memory is insufficient or the number of services reaches the upper limit. 127761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 127861847f8eSopenharmony_ci * @atomicservice 127961847f8eSopenharmony_ci * @since 11 128061847f8eSopenharmony_ci */ 128161847f8eSopenharmony_ci /** 128261847f8eSopenharmony_ci * The system memory is insufficient or the number of services reaches the upper limit. 128361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 128461847f8eSopenharmony_ci * @crossplatform 128561847f8eSopenharmony_ci * @atomicservice 128661847f8eSopenharmony_ci * @since 12 128761847f8eSopenharmony_ci */ 128861847f8eSopenharmony_ci AVERR_NO_MEMORY = 5400101, 128961847f8eSopenharmony_ci 129061847f8eSopenharmony_ci /** 129161847f8eSopenharmony_ci * Current status does not allow or do not have permission to perform this operation. 129261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 129361847f8eSopenharmony_ci * @since 9 129461847f8eSopenharmony_ci */ 129561847f8eSopenharmony_ci /** 129661847f8eSopenharmony_ci * Current status does not allow or do not have permission to perform this operation. 129761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 129861847f8eSopenharmony_ci * @atomicservice 129961847f8eSopenharmony_ci * @since 11 130061847f8eSopenharmony_ci */ 130161847f8eSopenharmony_ci /** 130261847f8eSopenharmony_ci * Current status does not allow or do not have permission to perform this operation. 130361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 130461847f8eSopenharmony_ci * @crossplatform 130561847f8eSopenharmony_ci * @atomicservice 130661847f8eSopenharmony_ci * @since 12 130761847f8eSopenharmony_ci */ 130861847f8eSopenharmony_ci AVERR_OPERATE_NOT_PERMIT = 5400102, 130961847f8eSopenharmony_ci 131061847f8eSopenharmony_ci /** 131161847f8eSopenharmony_ci * Data flow exception information. 131261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 131361847f8eSopenharmony_ci * @since 9 131461847f8eSopenharmony_ci */ 131561847f8eSopenharmony_ci /** 131661847f8eSopenharmony_ci * Data flow exception information. 131761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 131861847f8eSopenharmony_ci * @atomicservice 131961847f8eSopenharmony_ci * @since 11 132061847f8eSopenharmony_ci */ 132161847f8eSopenharmony_ci /** 132261847f8eSopenharmony_ci * Data flow exception information. 132361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 132461847f8eSopenharmony_ci * @crossplatform 132561847f8eSopenharmony_ci * @atomicservice 132661847f8eSopenharmony_ci * @since 12 132761847f8eSopenharmony_ci */ 132861847f8eSopenharmony_ci AVERR_IO = 5400103, 132961847f8eSopenharmony_ci 133061847f8eSopenharmony_ci /** 133161847f8eSopenharmony_ci * System or network response timeout. 133261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 133361847f8eSopenharmony_ci * @since 9 133461847f8eSopenharmony_ci */ 133561847f8eSopenharmony_ci /** 133661847f8eSopenharmony_ci * System or network response timeout. 133761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 133861847f8eSopenharmony_ci * @atomicservice 133961847f8eSopenharmony_ci * @since 11 134061847f8eSopenharmony_ci */ 134161847f8eSopenharmony_ci /** 134261847f8eSopenharmony_ci * System or network response timeout. 134361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 134461847f8eSopenharmony_ci * @crossplatform 134561847f8eSopenharmony_ci * @atomicservice 134661847f8eSopenharmony_ci * @since 12 134761847f8eSopenharmony_ci */ 134861847f8eSopenharmony_ci AVERR_TIMEOUT = 5400104, 134961847f8eSopenharmony_ci 135061847f8eSopenharmony_ci /** 135161847f8eSopenharmony_ci * Service process died. 135261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 135361847f8eSopenharmony_ci * @since 9 135461847f8eSopenharmony_ci */ 135561847f8eSopenharmony_ci /** 135661847f8eSopenharmony_ci * Service process died. 135761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 135861847f8eSopenharmony_ci * @atomicservice 135961847f8eSopenharmony_ci * @since 11 136061847f8eSopenharmony_ci */ 136161847f8eSopenharmony_ci /** 136261847f8eSopenharmony_ci * Service process died. 136361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 136461847f8eSopenharmony_ci * @crossplatform 136561847f8eSopenharmony_ci * @atomicservice 136661847f8eSopenharmony_ci * @since 12 136761847f8eSopenharmony_ci */ 136861847f8eSopenharmony_ci AVERR_SERVICE_DIED = 5400105, 136961847f8eSopenharmony_ci 137061847f8eSopenharmony_ci /** 137161847f8eSopenharmony_ci * Unsupported media format. 137261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 137361847f8eSopenharmony_ci * @since 9 137461847f8eSopenharmony_ci */ 137561847f8eSopenharmony_ci /** 137661847f8eSopenharmony_ci * Unsupported media format. 137761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 137861847f8eSopenharmony_ci * @atomicservice 137961847f8eSopenharmony_ci * @since 11 138061847f8eSopenharmony_ci */ 138161847f8eSopenharmony_ci /** 138261847f8eSopenharmony_ci * Unsupported media format. 138361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 138461847f8eSopenharmony_ci * @crossplatform 138561847f8eSopenharmony_ci * @atomicservice 138661847f8eSopenharmony_ci * @since 12 138761847f8eSopenharmony_ci */ 138861847f8eSopenharmony_ci AVERR_UNSUPPORT_FORMAT = 5400106, 138961847f8eSopenharmony_ci 139061847f8eSopenharmony_ci /** 139161847f8eSopenharmony_ci * Audio interrupted. 139261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 139361847f8eSopenharmony_ci * @atomicservice 139461847f8eSopenharmony_ci * @since 11 139561847f8eSopenharmony_ci */ 139661847f8eSopenharmony_ci /** 139761847f8eSopenharmony_ci * Audio interrupted. 139861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 139961847f8eSopenharmony_ci * @crossplatform 140061847f8eSopenharmony_ci * @atomicservice 140161847f8eSopenharmony_ci * @since 12 140261847f8eSopenharmony_ci */ 140361847f8eSopenharmony_ci AVERR_AUDIO_INTERRUPTED = 5400107, 140461847f8eSopenharmony_ci /** 140561847f8eSopenharmony_ci * The address of server is incorrect, and IO can not find host. 140661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 140761847f8eSopenharmony_ci * @crossplatform 140861847f8eSopenharmony_ci * @atomicservice 140961847f8eSopenharmony_ci * @since 14 141061847f8eSopenharmony_ci */ 141161847f8eSopenharmony_ci AVERR_IO_HOST_NOT_FOUND = 5411001, 141261847f8eSopenharmony_ci /** 141361847f8eSopenharmony_ci * Network connection timeout. 141461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 141561847f8eSopenharmony_ci * @crossplatform 141661847f8eSopenharmony_ci * @atomicservice 141761847f8eSopenharmony_ci * @since 14 141861847f8eSopenharmony_ci */ 141961847f8eSopenharmony_ci AVERR_IO_CONNECTION_TIMEOUT = 5411002, 142061847f8eSopenharmony_ci /** 142161847f8eSopenharmony_ci * Failed link due to abnormal network. 142261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 142361847f8eSopenharmony_ci * @crossplatform 142461847f8eSopenharmony_ci * @atomicservice 142561847f8eSopenharmony_ci * @since 14 142661847f8eSopenharmony_ci */ 142761847f8eSopenharmony_ci AVERR_IO_NETWORK_ABNORMAL = 5411003, 142861847f8eSopenharmony_ci /** 142961847f8eSopenharmony_ci * Failed link due to unavailable network. 143061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 143161847f8eSopenharmony_ci * @crossplatform 143261847f8eSopenharmony_ci * @atomicservice 143361847f8eSopenharmony_ci * @since 14 143461847f8eSopenharmony_ci */ 143561847f8eSopenharmony_ci AVERR_IO_NETWORK_UNAVAILABLE = 5411004, 143661847f8eSopenharmony_ci /** 143761847f8eSopenharmony_ci * Network permission dennied. 143861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 143961847f8eSopenharmony_ci * @crossplatform 144061847f8eSopenharmony_ci * @atomicservice 144161847f8eSopenharmony_ci * @since 14 144261847f8eSopenharmony_ci */ 144361847f8eSopenharmony_ci AVERR_IO_NO_PERMISSION = 5411005, 144461847f8eSopenharmony_ci /** 144561847f8eSopenharmony_ci * The client request parameters are incorrect or exceed the processing capacity. 144661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 144761847f8eSopenharmony_ci * @crossplatform 144861847f8eSopenharmony_ci * @atomicservice 144961847f8eSopenharmony_ci * @since 14 145061847f8eSopenharmony_ci */ 145161847f8eSopenharmony_ci AVERR_IO_REQUEST_DENIED = 5411006, 145261847f8eSopenharmony_ci /** 145361847f8eSopenharmony_ci * Cannot find available network resources. 145461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 145561847f8eSopenharmony_ci * @crossplatform 145661847f8eSopenharmony_ci * @atomicservice 145761847f8eSopenharmony_ci * @since 14 145861847f8eSopenharmony_ci */ 145961847f8eSopenharmony_ci AVERR_IO_RESOURCE_NOT_FOUND = 5411007, 146061847f8eSopenharmony_ci /** 146161847f8eSopenharmony_ci * The server failS to verify the client certificate because the certificate is not carried, 146261847f8eSopenharmony_ci * the certificate is invalid, or the certificate is expired. 146361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 146461847f8eSopenharmony_ci * @crossplatform 146561847f8eSopenharmony_ci * @atomicservice 146661847f8eSopenharmony_ci * @since 14 146761847f8eSopenharmony_ci */ 146861847f8eSopenharmony_ci AVERR_IO_SSL_CLIENT_CERT_NEEDED = 5411008, 146961847f8eSopenharmony_ci /** 147061847f8eSopenharmony_ci * The client fails to verify the server certificate because the certificate is not carried, 147161847f8eSopenharmony_ci * the certificate is invalid, or the certificate is expired. 147261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 147361847f8eSopenharmony_ci * @crossplatform 147461847f8eSopenharmony_ci * @atomicservice 147561847f8eSopenharmony_ci * @since 14 147661847f8eSopenharmony_ci */ 147761847f8eSopenharmony_ci AVERR_IO_SSL_CONNECTION_FAILED = 5411009, 147861847f8eSopenharmony_ci /** 147961847f8eSopenharmony_ci * IO SSL server cert untrusted. 148061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 148161847f8eSopenharmony_ci * @crossplatform 148261847f8eSopenharmony_ci * @atomicservice 148361847f8eSopenharmony_ci * @since 14 148461847f8eSopenharmony_ci */ 148561847f8eSopenharmony_ci AVERR_IO_SSL_SERVER_CERT_UNTRUSTED = 5411010, 148661847f8eSopenharmony_ci /** 148761847f8eSopenharmony_ci * Unsupported request due to network protocols. 148861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 148961847f8eSopenharmony_ci * @crossplatform 149061847f8eSopenharmony_ci * @atomicservice 149161847f8eSopenharmony_ci * @since 14 149261847f8eSopenharmony_ci */ 149361847f8eSopenharmony_ci AVERR_IO_UNSUPPORTED_REQUEST = 5411011, 149461847f8eSopenharmony_ci /** 149561847f8eSopenharmony_ci * The file data is incorrect, and no specific data can be provided. 149661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 149761847f8eSopenharmony_ci * @crossplatform 149861847f8eSopenharmony_ci * @atomicservice 149961847f8eSopenharmony_ci * @since 14 150061847f8eSopenharmony_ci */ 150161847f8eSopenharmony_ci AVERR_IO_DATA_ABNORMAL = 5411012, 150261847f8eSopenharmony_ci /** 150361847f8eSopenharmony_ci * The file is occupied by other processes and cannot be accessed. 150461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 150561847f8eSopenharmony_ci * @crossplatform 150661847f8eSopenharmony_ci * @atomicservice 150761847f8eSopenharmony_ci * @since 14 150861847f8eSopenharmony_ci */ 150961847f8eSopenharmony_ci AVERR_IO_FILE_ACCESS_DENIED = 5411013, 151061847f8eSopenharmony_ci /** 151161847f8eSopenharmony_ci * The file handle is incorrect. 151261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 151361847f8eSopenharmony_ci * @crossplatform 151461847f8eSopenharmony_ci * @atomicservice 151561847f8eSopenharmony_ci * @since 14 151661847f8eSopenharmony_ci */ 151761847f8eSopenharmony_ci AVERR_IO_FILE_BAD_HANDLE = 5411014, 151861847f8eSopenharmony_ci /** 151961847f8eSopenharmony_ci * IO file not found. 152061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 152161847f8eSopenharmony_ci * @crossplatform 152261847f8eSopenharmony_ci * @atomicservice 152361847f8eSopenharmony_ci * @since 14 152461847f8eSopenharmony_ci */ 152561847f8eSopenharmony_ci AVERR_IO_FILE_NOT_FOUND = 5411015, 152661847f8eSopenharmony_ci /** 152761847f8eSopenharmony_ci * IO file permission denied because API does not have permissions. 152861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 152961847f8eSopenharmony_ci * @crossplatform 153061847f8eSopenharmony_ci * @atomicservice 153161847f8eSopenharmony_ci * @since 14 153261847f8eSopenharmony_ci */ 153361847f8eSopenharmony_ci AVERR_IO_FILE_PERMISSION_DENIED = 5411016, 153461847f8eSopenharmony_ci /** 153561847f8eSopenharmony_ci * Failed to decode the audio data. 153661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 153761847f8eSopenharmony_ci * @crossplatform 153861847f8eSopenharmony_ci * @atomicservice 153961847f8eSopenharmony_ci * @since 14 154061847f8eSopenharmony_ci */ 154161847f8eSopenharmony_ci AVERR_IO_AUDIO_DEC_FAILED = 5411017, 154261847f8eSopenharmony_ci /** 154361847f8eSopenharmony_ci * Fail to init the audio decoder. 154461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 154561847f8eSopenharmony_ci * @crossplatform 154661847f8eSopenharmony_ci * @atomicservice 154761847f8eSopenharmony_ci * @since 14 154861847f8eSopenharmony_ci */ 154961847f8eSopenharmony_ci AVERR_IO_AUDIO_DEC_INIT_FAILED = 5411018, 155061847f8eSopenharmony_ci /** 155161847f8eSopenharmony_ci * The audio decoder is unavailable for handler incurrupt, or audio decoder subsystem abnormal. 155261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 155361847f8eSopenharmony_ci * @crossplatform 155461847f8eSopenharmony_ci * @atomicservice 155561847f8eSopenharmony_ci * @since 14 155661847f8eSopenharmony_ci */ 155761847f8eSopenharmony_ci AVERR_IO_AUDIO_DEC_UNAVAILABLE = 5411019, 155861847f8eSopenharmony_ci /** 155961847f8eSopenharmony_ci * Audio device error. 156061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 156161847f8eSopenharmony_ci * @crossplatform 156261847f8eSopenharmony_ci * @atomicservice 156361847f8eSopenharmony_ci * @since 14 156461847f8eSopenharmony_ci */ 156561847f8eSopenharmony_ci AVERR_IO_AUDIO_DEVICE_ERROR = 5411020, 156661847f8eSopenharmony_ci /** 156761847f8eSopenharmony_ci * The audio device state does not support the current operation. 156861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 156961847f8eSopenharmony_ci * @crossplatform 157061847f8eSopenharmony_ci * @atomicservice 157161847f8eSopenharmony_ci * @since 14 157261847f8eSopenharmony_ci */ 157361847f8eSopenharmony_ci AVERR_IO_AUDIO_DEVICE_INVALID_STATE = 5411021, 157461847f8eSopenharmony_ci /** 157561847f8eSopenharmony_ci * Audio device timeout when calling audio render interface. 157661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 157761847f8eSopenharmony_ci * @crossplatform 157861847f8eSopenharmony_ci * @atomicservice 157961847f8eSopenharmony_ci * @since 14 158061847f8eSopenharmony_ci */ 158161847f8eSopenharmony_ci AVERR_IO_AUDIO_DEVICE_TIMEOUT = 5411022, 158261847f8eSopenharmony_ci /** 158361847f8eSopenharmony_ci * Audio device unavailable, unable to create an audio device. 158461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 158561847f8eSopenharmony_ci * @crossplatform 158661847f8eSopenharmony_ci * @atomicservice 158761847f8eSopenharmony_ci * @since 14 158861847f8eSopenharmony_ci */ 158961847f8eSopenharmony_ci AVERR_IO_AUDIO_DEVICE_UNAVAILABLE = 5411023, 159061847f8eSopenharmony_ci /** 159161847f8eSopenharmony_ci * Failed to encode the audio data. 159261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 159361847f8eSopenharmony_ci * @crossplatform 159461847f8eSopenharmony_ci * @atomicservice 159561847f8eSopenharmony_ci * @since 14 159661847f8eSopenharmony_ci */ 159761847f8eSopenharmony_ci AVERR_IO_AUDIO_ENC_FAILED = 5411024, 159861847f8eSopenharmony_ci /** 159961847f8eSopenharmony_ci * Fail to init the audio encoder. 160061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 160161847f8eSopenharmony_ci * @crossplatform 160261847f8eSopenharmony_ci * @atomicservice 160361847f8eSopenharmony_ci * @since 14 160461847f8eSopenharmony_ci */ 160561847f8eSopenharmony_ci AVERR_IO_AUDIO_ENC_INIT_FAILED = 5411025, 160661847f8eSopenharmony_ci /** 160761847f8eSopenharmony_ci * The audio encoder is unavailable for handler incurrupt, or audio encoder subsystem abnormal. 160861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 160961847f8eSopenharmony_ci * @crossplatform 161061847f8eSopenharmony_ci * @atomicservice 161161847f8eSopenharmony_ci * @since 14 161261847f8eSopenharmony_ci */ 161361847f8eSopenharmony_ci AVERR_IO_AUDIO_ENC_UNAVAILABLE = 5411026, 161461847f8eSopenharmony_ci /** 161561847f8eSopenharmony_ci * Failed to decode the video data. 161661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 161761847f8eSopenharmony_ci * @crossplatform 161861847f8eSopenharmony_ci * @atomicservice 161961847f8eSopenharmony_ci * @since 14 162061847f8eSopenharmony_ci */ 162161847f8eSopenharmony_ci AVERR_IO_VIDEO_DEC_FAILED = 5411027, 162261847f8eSopenharmony_ci /** 162361847f8eSopenharmony_ci * Fail to init the video decoder. 162461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 162561847f8eSopenharmony_ci * @crossplatform 162661847f8eSopenharmony_ci * @atomicservice 162761847f8eSopenharmony_ci * @since 14 162861847f8eSopenharmony_ci */ 162961847f8eSopenharmony_ci AVERR_IO_VIDEO_DEC_INIT_FAILED = 5411028, 163061847f8eSopenharmony_ci /** 163161847f8eSopenharmony_ci * The video decoder is unavailable for handler incurrupt, or video decoder subsystem abnormal. 163261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 163361847f8eSopenharmony_ci * @crossplatform 163461847f8eSopenharmony_ci * @atomicservice 163561847f8eSopenharmony_ci * @since 14 163661847f8eSopenharmony_ci */ 163761847f8eSopenharmony_ci AVERR_IO_VIDEO_DEC_UNAVAILABLE = 5411029, 163861847f8eSopenharmony_ci /** 163961847f8eSopenharmony_ci * Video device error. 164061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 164161847f8eSopenharmony_ci * @crossplatform 164261847f8eSopenharmony_ci * @atomicservice 164361847f8eSopenharmony_ci * @since 14 164461847f8eSopenharmony_ci */ 164561847f8eSopenharmony_ci AVERR_IO_VIDEO_DEVICE_ERROR = 5411030, 164661847f8eSopenharmony_ci /** 164761847f8eSopenharmony_ci * Failed to encode the video data. 164861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 164961847f8eSopenharmony_ci * @crossplatform 165061847f8eSopenharmony_ci * @atomicservice 165161847f8eSopenharmony_ci * @since 14 165261847f8eSopenharmony_ci */ 165361847f8eSopenharmony_ci AVERR_IO_VIDEO_ENC_FAILED = 5411031, 165461847f8eSopenharmony_ci /** 165561847f8eSopenharmony_ci * Failed to init the video encoder. 165661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 165761847f8eSopenharmony_ci * @crossplatform 165861847f8eSopenharmony_ci * @atomicservice 165961847f8eSopenharmony_ci * @since 14 166061847f8eSopenharmony_ci */ 166161847f8eSopenharmony_ci AVERR_IO_VIDEO_ENC_INIT_FAILED = 5411032, 166261847f8eSopenharmony_ci /** 166361847f8eSopenharmony_ci * The video encoder is unavailable for handler incurrupt, or video encoder subsystem abnormal. 166461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 166561847f8eSopenharmony_ci * @crossplatform 166661847f8eSopenharmony_ci * @atomicservice 166761847f8eSopenharmony_ci * @since 14 166861847f8eSopenharmony_ci */ 166961847f8eSopenharmony_ci AVERR_IO_VIDEO_ENC_UNAVAILABLE = 5411033, 167061847f8eSopenharmony_ci } 167161847f8eSopenharmony_ci 167261847f8eSopenharmony_ci /** 167361847f8eSopenharmony_ci * Describes AVPlayer states. 167461847f8eSopenharmony_ci * @typedef {'idle' | 'initialized' | 'prepared' | 'playing' | 'paused' | 'completed' | 'stopped' | 'released' | 'error'} 167561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 167661847f8eSopenharmony_ci * @since 9 167761847f8eSopenharmony_ci 167861847f8eSopenharmony_ci */ 167961847f8eSopenharmony_ci /** 168061847f8eSopenharmony_ci * Describes AVPlayer states. 168161847f8eSopenharmony_ci * @typedef {'idle' | 'initialized' | 'prepared' | 'playing' | 'paused' | 'completed' | 'stopped' | 'released' | 'error'} 168261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 168361847f8eSopenharmony_ci * @atomicservice 168461847f8eSopenharmony_ci * @since 11 168561847f8eSopenharmony_ci 168661847f8eSopenharmony_ci */ 168761847f8eSopenharmony_ci /** 168861847f8eSopenharmony_ci * Describes AVPlayer states. 168961847f8eSopenharmony_ci * @typedef {'idle' | 'initialized' | 'prepared' | 'playing' | 'paused' | 'completed' | 'stopped' | 'released' | 'error'} 169061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 169161847f8eSopenharmony_ci * @crossplatform 169261847f8eSopenharmony_ci * @atomicservice 169361847f8eSopenharmony_ci * @since 12 169461847f8eSopenharmony_ci */ 169561847f8eSopenharmony_ci type AVPlayerState = 'idle' | 'initialized' | 'prepared' | 'playing' | 'paused' | 'completed' | 'stopped' | 'released' | 'error'; 169661847f8eSopenharmony_ci 169761847f8eSopenharmony_ci /** 169861847f8eSopenharmony_ci * Define the TrackChange Event callback. 169961847f8eSopenharmony_ci * @typedef { function } OnTrackChangeHandler 170061847f8eSopenharmony_ci * @param { number } index - index number for change Track. 170161847f8eSopenharmony_ci * @param { boolean } isSelected - Target index number for moving elements. 170261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 170361847f8eSopenharmony_ci * @atomicservice 170461847f8eSopenharmony_ci * @since 12 170561847f8eSopenharmony_ci */ 170661847f8eSopenharmony_ci type OnTrackChangeHandler = (index: number, isSelected: boolean) => void; 170761847f8eSopenharmony_ci 170861847f8eSopenharmony_ci /** 170961847f8eSopenharmony_ci * Defines the OnStateChange callback. 171061847f8eSopenharmony_ci * 171161847f8eSopenharmony_ci * @typedef { function } OnAVPlayerStateChangeHandle 171261847f8eSopenharmony_ci * @param { AVPlayerState } state - state for AVPlayer. 171361847f8eSopenharmony_ci * @param { StateChangeReason } reason - reason for state change. 171461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 171561847f8eSopenharmony_ci * @crossplatform 171661847f8eSopenharmony_ci * @atomicservice 171761847f8eSopenharmony_ci * @since 12 171861847f8eSopenharmony_ci */ 171961847f8eSopenharmony_ci type OnAVPlayerStateChangeHandle = (state: AVPlayerState, reason: StateChangeReason) => void; 172061847f8eSopenharmony_ci 172161847f8eSopenharmony_ci /** 172261847f8eSopenharmony_ci * Defines the OnBufferingUpdateHandler callback. 172361847f8eSopenharmony_ci * 172461847f8eSopenharmony_ci * @typedef { function } OnBufferingUpdateHandler 172561847f8eSopenharmony_ci * @param { BufferingInfoType } infoType - define the Buffering info Type. 172661847f8eSopenharmony_ci * @param { number } value - define the value of buffering info type if exist. 172761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 172861847f8eSopenharmony_ci * @crossplatform 172961847f8eSopenharmony_ci * @atomicservice 173061847f8eSopenharmony_ci * @since 12 173161847f8eSopenharmony_ci */ 173261847f8eSopenharmony_ci type OnBufferingUpdateHandler = (infoType: BufferingInfoType, value: number) => void; 173361847f8eSopenharmony_ci 173461847f8eSopenharmony_ci /** 173561847f8eSopenharmony_ci * Defines the OnVideoSizeChangeHandler callback. 173661847f8eSopenharmony_ci * 173761847f8eSopenharmony_ci * @typedef { function } OnVideoSizeChangeHandler 173861847f8eSopenharmony_ci * @param { number } width - Value of video Width. 173961847f8eSopenharmony_ci * @param { number } height - Value of video Height. 174061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 174161847f8eSopenharmony_ci * @crossplatform 174261847f8eSopenharmony_ci * @atomicservice 174361847f8eSopenharmony_ci * @since 12 174461847f8eSopenharmony_ci */ 174561847f8eSopenharmony_ci type OnVideoSizeChangeHandler = (width: number, height: number) => void; 174661847f8eSopenharmony_ci 174761847f8eSopenharmony_ci /** 174861847f8eSopenharmony_ci * Manages and plays media. Before calling an AVPlayer method, you must use createAVPlayer() 174961847f8eSopenharmony_ci * to create an AVPlayer instance. 175061847f8eSopenharmony_ci * 175161847f8eSopenharmony_ci * @typedef AVPlayer 175261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 175361847f8eSopenharmony_ci * @since 9 175461847f8eSopenharmony_ci */ 175561847f8eSopenharmony_ci /** 175661847f8eSopenharmony_ci * Manages and plays media. Before calling an AVPlayer method, you must use createAVPlayer() 175761847f8eSopenharmony_ci * to create an AVPlayer instance. 175861847f8eSopenharmony_ci * 175961847f8eSopenharmony_ci * @typedef AVPlayer 176061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 176161847f8eSopenharmony_ci * @atomicservice 176261847f8eSopenharmony_ci * @since 11 176361847f8eSopenharmony_ci */ 176461847f8eSopenharmony_ci /** 176561847f8eSopenharmony_ci * Manages and plays media. Before calling an AVPlayer method, you must use createAVPlayer() 176661847f8eSopenharmony_ci * to create an AVPlayer instance. 176761847f8eSopenharmony_ci * 176861847f8eSopenharmony_ci * @typedef AVPlayer 176961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 177061847f8eSopenharmony_ci * @crossplatform 177161847f8eSopenharmony_ci * @atomicservice 177261847f8eSopenharmony_ci * @since 12 177361847f8eSopenharmony_ci */ 177461847f8eSopenharmony_ci interface AVPlayer { 177561847f8eSopenharmony_ci /** 177661847f8eSopenharmony_ci * Prepare audio/video playback, it will request resource for playing. 177761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when prepare completed. 177861847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 177961847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Return by callback. 178061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 178161847f8eSopenharmony_ci * @since 9 178261847f8eSopenharmony_ci */ 178361847f8eSopenharmony_ci /** 178461847f8eSopenharmony_ci * Prepare audio/video playback, it will request resource for playing. 178561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when prepare completed. 178661847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 178761847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Return by callback. 178861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 178961847f8eSopenharmony_ci * @atomicservice 179061847f8eSopenharmony_ci * @since 11 179161847f8eSopenharmony_ci */ 179261847f8eSopenharmony_ci /** 179361847f8eSopenharmony_ci * Prepare audio/video playback, it will request resource for playing. 179461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when prepare completed. 179561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 179661847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupport format. Return by callback. 179761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 179861847f8eSopenharmony_ci * @crossplatform 179961847f8eSopenharmony_ci * @atomicservice 180061847f8eSopenharmony_ci * @since 12 180161847f8eSopenharmony_ci */ 180261847f8eSopenharmony_ci prepare(callback: AsyncCallback<void>): void; 180361847f8eSopenharmony_ci 180461847f8eSopenharmony_ci /** 180561847f8eSopenharmony_ci * Prepare audio/video playback, it will request resource for playing. 180661847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when prepare completed. 180761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 180861847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Return by promise. 180961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 181061847f8eSopenharmony_ci * @since 9 181161847f8eSopenharmony_ci */ 181261847f8eSopenharmony_ci /** 181361847f8eSopenharmony_ci * Prepare audio/video playback, it will request resource for playing. 181461847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when prepare completed. 181561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 181661847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Return by promise. 181761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 181861847f8eSopenharmony_ci * @atomicservice 181961847f8eSopenharmony_ci * @since 11 182061847f8eSopenharmony_ci */ 182161847f8eSopenharmony_ci /** 182261847f8eSopenharmony_ci * Prepare audio/video playback, it will request resource for playing. 182361847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when prepare completed. 182461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 182561847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupport format. Return by promise. 182661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 182761847f8eSopenharmony_ci * @crossplatform 182861847f8eSopenharmony_ci * @atomicservice 182961847f8eSopenharmony_ci * @since 12 183061847f8eSopenharmony_ci */ 183161847f8eSopenharmony_ci prepare(): Promise<void>; 183261847f8eSopenharmony_ci 183361847f8eSopenharmony_ci /** 183461847f8eSopenharmony_ci * Play audio/video playback. 183561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when play completed. 183661847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 183761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 183861847f8eSopenharmony_ci * @since 9 183961847f8eSopenharmony_ci */ 184061847f8eSopenharmony_ci /** 184161847f8eSopenharmony_ci * Play audio/video playback. 184261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when play completed. 184361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 184461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 184561847f8eSopenharmony_ci * @atomicservice 184661847f8eSopenharmony_ci * @since 11 184761847f8eSopenharmony_ci */ 184861847f8eSopenharmony_ci /** 184961847f8eSopenharmony_ci * Play audio/video playback. 185061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when play completed. 185161847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 185261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 185361847f8eSopenharmony_ci * @crossplatform 185461847f8eSopenharmony_ci * @atomicservice 185561847f8eSopenharmony_ci * @since 12 185661847f8eSopenharmony_ci */ 185761847f8eSopenharmony_ci play(callback: AsyncCallback<void>): void; 185861847f8eSopenharmony_ci 185961847f8eSopenharmony_ci /** 186061847f8eSopenharmony_ci * Play audio/video playback. 186161847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when play completed. 186261847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 186361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 186461847f8eSopenharmony_ci * @since 9 186561847f8eSopenharmony_ci */ 186661847f8eSopenharmony_ci /** 186761847f8eSopenharmony_ci * Play audio/video playback. 186861847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when play completed. 186961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 187061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 187161847f8eSopenharmony_ci * @atomicservice 187261847f8eSopenharmony_ci * @since 11 187361847f8eSopenharmony_ci */ 187461847f8eSopenharmony_ci /** 187561847f8eSopenharmony_ci * Play audio/video playback. 187661847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when play completed. 187761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 187861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 187961847f8eSopenharmony_ci * @crossplatform 188061847f8eSopenharmony_ci * @atomicservice 188161847f8eSopenharmony_ci * @since 12 188261847f8eSopenharmony_ci */ 188361847f8eSopenharmony_ci play(): Promise<void>; 188461847f8eSopenharmony_ci 188561847f8eSopenharmony_ci /** 188661847f8eSopenharmony_ci * Pause audio/video playback. 188761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when pause completed. 188861847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 188961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 189061847f8eSopenharmony_ci * @since 9 189161847f8eSopenharmony_ci */ 189261847f8eSopenharmony_ci /** 189361847f8eSopenharmony_ci * Pause audio/video playback. 189461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when pause completed. 189561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 189661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 189761847f8eSopenharmony_ci * @atomicservice 189861847f8eSopenharmony_ci * @since 11 189961847f8eSopenharmony_ci */ 190061847f8eSopenharmony_ci /** 190161847f8eSopenharmony_ci * Pause audio/video playback. 190261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when pause completed. 190361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 190461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 190561847f8eSopenharmony_ci * @crossplatform 190661847f8eSopenharmony_ci * @atomicservice 190761847f8eSopenharmony_ci * @since 12 190861847f8eSopenharmony_ci */ 190961847f8eSopenharmony_ci pause(callback: AsyncCallback<void>): void; 191061847f8eSopenharmony_ci 191161847f8eSopenharmony_ci /** 191261847f8eSopenharmony_ci * Pause audio/video playback. 191361847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when pause completed. 191461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 191561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 191661847f8eSopenharmony_ci * @since 9 191761847f8eSopenharmony_ci */ 191861847f8eSopenharmony_ci /** 191961847f8eSopenharmony_ci * Pause audio/video playback. 192061847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when pause completed. 192161847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 192261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 192361847f8eSopenharmony_ci * @atomicservice 192461847f8eSopenharmony_ci * @since 11 192561847f8eSopenharmony_ci */ 192661847f8eSopenharmony_ci /** 192761847f8eSopenharmony_ci * Pause audio/video playback. 192861847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when pause completed. 192961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 193061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 193161847f8eSopenharmony_ci * @crossplatform 193261847f8eSopenharmony_ci * @atomicservice 193361847f8eSopenharmony_ci * @since 12 193461847f8eSopenharmony_ci */ 193561847f8eSopenharmony_ci pause(): Promise<void>; 193661847f8eSopenharmony_ci 193761847f8eSopenharmony_ci /** 193861847f8eSopenharmony_ci * Stop audio/video playback. 193961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when stop completed. 194061847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 194161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 194261847f8eSopenharmony_ci * @since 9 194361847f8eSopenharmony_ci */ 194461847f8eSopenharmony_ci /** 194561847f8eSopenharmony_ci * Stop audio/video playback. 194661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when stop completed. 194761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 194861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 194961847f8eSopenharmony_ci * @atomicservice 195061847f8eSopenharmony_ci * @since 11 195161847f8eSopenharmony_ci */ 195261847f8eSopenharmony_ci /** 195361847f8eSopenharmony_ci * Stop audio/video playback. 195461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when stop completed. 195561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 195661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 195761847f8eSopenharmony_ci * @crossplatform 195861847f8eSopenharmony_ci * @atomicservice 195961847f8eSopenharmony_ci * @since 12 196061847f8eSopenharmony_ci */ 196161847f8eSopenharmony_ci stop(callback: AsyncCallback<void>): void; 196261847f8eSopenharmony_ci 196361847f8eSopenharmony_ci /** 196461847f8eSopenharmony_ci * Stop audio/video playback. 196561847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when stop completed. 196661847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 196761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 196861847f8eSopenharmony_ci * @since 9 196961847f8eSopenharmony_ci */ 197061847f8eSopenharmony_ci /** 197161847f8eSopenharmony_ci * Stop audio/video playback. 197261847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when stop completed. 197361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 197461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 197561847f8eSopenharmony_ci * @atomicservice 197661847f8eSopenharmony_ci * @since 11 197761847f8eSopenharmony_ci */ 197861847f8eSopenharmony_ci /** 197961847f8eSopenharmony_ci * Stop audio/video playback. 198061847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when stop completed. 198161847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 198261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 198361847f8eSopenharmony_ci * @crossplatform 198461847f8eSopenharmony_ci * @atomicservice 198561847f8eSopenharmony_ci * @since 12 198661847f8eSopenharmony_ci */ 198761847f8eSopenharmony_ci stop(): Promise<void>; 198861847f8eSopenharmony_ci 198961847f8eSopenharmony_ci /** 199061847f8eSopenharmony_ci * Reset AVPlayer, it will to idle state and can set src again. 199161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when reset completed. 199261847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 199361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 199461847f8eSopenharmony_ci * @since 9 199561847f8eSopenharmony_ci */ 199661847f8eSopenharmony_ci /** 199761847f8eSopenharmony_ci * Reset AVPlayer, it will to idle state and can set src again. 199861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when reset completed. 199961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 200061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 200161847f8eSopenharmony_ci * @atomicservice 200261847f8eSopenharmony_ci * @since 11 200361847f8eSopenharmony_ci */ 200461847f8eSopenharmony_ci /** 200561847f8eSopenharmony_ci * Reset AVPlayer, it will to idle state and can set src again. 200661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when reset completed. 200761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 200861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 200961847f8eSopenharmony_ci * @crossplatform 201061847f8eSopenharmony_ci * @atomicservice 201161847f8eSopenharmony_ci * @since 12 201261847f8eSopenharmony_ci */ 201361847f8eSopenharmony_ci reset(callback: AsyncCallback<void>): void; 201461847f8eSopenharmony_ci 201561847f8eSopenharmony_ci /** 201661847f8eSopenharmony_ci * Reset AVPlayer, it will to idle state and can set src again. 201761847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when reset completed. 201861847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 201961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 202061847f8eSopenharmony_ci * @since 9 202161847f8eSopenharmony_ci */ 202261847f8eSopenharmony_ci /** 202361847f8eSopenharmony_ci * Reset AVPlayer, it will to idle state and can set src again. 202461847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when reset completed. 202561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 202661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 202761847f8eSopenharmony_ci * @atomicservice 202861847f8eSopenharmony_ci * @since 11 202961847f8eSopenharmony_ci */ 203061847f8eSopenharmony_ci /** 203161847f8eSopenharmony_ci * Reset AVPlayer, it will to idle state and can set src again. 203261847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when reset completed. 203361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 203461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 203561847f8eSopenharmony_ci * @crossplatform 203661847f8eSopenharmony_ci * @atomicservice 203761847f8eSopenharmony_ci * @since 12 203861847f8eSopenharmony_ci */ 203961847f8eSopenharmony_ci reset(): Promise<void>; 204061847f8eSopenharmony_ci 204161847f8eSopenharmony_ci /** 204261847f8eSopenharmony_ci * Releases resources used for AVPlayer. 204361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when release completed. 204461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 204561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 204661847f8eSopenharmony_ci * @since 9 204761847f8eSopenharmony_ci */ 204861847f8eSopenharmony_ci /** 204961847f8eSopenharmony_ci * Releases resources used for AVPlayer. 205061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when release completed. 205161847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 205261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 205361847f8eSopenharmony_ci * @atomicservice 205461847f8eSopenharmony_ci * @since 11 205561847f8eSopenharmony_ci */ 205661847f8eSopenharmony_ci /** 205761847f8eSopenharmony_ci * Releases resources used for AVPlayer. 205861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - instance used to return when release completed. 205961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 206061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 206161847f8eSopenharmony_ci * @crossplatform 206261847f8eSopenharmony_ci * @atomicservice 206361847f8eSopenharmony_ci * @since 12 206461847f8eSopenharmony_ci */ 206561847f8eSopenharmony_ci release(callback: AsyncCallback<void>): void; 206661847f8eSopenharmony_ci 206761847f8eSopenharmony_ci /** 206861847f8eSopenharmony_ci * Releases resources used for AVPlayer. 206961847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when release completed. 207061847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 207161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 207261847f8eSopenharmony_ci * @since 9 207361847f8eSopenharmony_ci */ 207461847f8eSopenharmony_ci /** 207561847f8eSopenharmony_ci * Releases resources used for AVPlayer. 207661847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when release completed. 207761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 207861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 207961847f8eSopenharmony_ci * @atomicservice 208061847f8eSopenharmony_ci * @since 11 208161847f8eSopenharmony_ci */ 208261847f8eSopenharmony_ci /** 208361847f8eSopenharmony_ci * Releases resources used for AVPlayer. 208461847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when release completed. 208561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 208661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 208761847f8eSopenharmony_ci * @crossplatform 208861847f8eSopenharmony_ci * @atomicservice 208961847f8eSopenharmony_ci * @since 12 209061847f8eSopenharmony_ci */ 209161847f8eSopenharmony_ci release(): Promise<void>; 209261847f8eSopenharmony_ci 209361847f8eSopenharmony_ci /** 209461847f8eSopenharmony_ci * Jumps to the specified playback position. 209561847f8eSopenharmony_ci * @param { number } timeMs - Playback position to jump, should be in [0, duration]. 209661847f8eSopenharmony_ci * @param { SeekMode } mode - See @SeekMode . 209761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 209861847f8eSopenharmony_ci * @since 9 209961847f8eSopenharmony_ci */ 210061847f8eSopenharmony_ci /** 210161847f8eSopenharmony_ci * Jumps to the specified playback position. 210261847f8eSopenharmony_ci * @param { number } timeMs - Playback position to jump, should be in [0, duration]. 210361847f8eSopenharmony_ci * @param { SeekMode } mode - See @SeekMode . 210461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 210561847f8eSopenharmony_ci * @atomicservice 210661847f8eSopenharmony_ci * @since 11 210761847f8eSopenharmony_ci */ 210861847f8eSopenharmony_ci /** 210961847f8eSopenharmony_ci * Jumps to the specified playback position. 211061847f8eSopenharmony_ci * @param { number } timeMs - Playback position to jump, should be in [0, duration]. 211161847f8eSopenharmony_ci * @param { SeekMode } mode - See @SeekMode . 211261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 211361847f8eSopenharmony_ci * @crossplatform 211461847f8eSopenharmony_ci * @atomicservice 211561847f8eSopenharmony_ci * @since 12 211661847f8eSopenharmony_ci */ 211761847f8eSopenharmony_ci seek(timeMs: number, mode?: SeekMode): void; 211861847f8eSopenharmony_ci 211961847f8eSopenharmony_ci /** 212061847f8eSopenharmony_ci * Sets the volume. 212161847f8eSopenharmony_ci * @param { number } volume - Relative volume. The value ranges from 0.00 to 1.00. The value 1 indicates the maximum volume (100%). 212261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 212361847f8eSopenharmony_ci * @since 9 212461847f8eSopenharmony_ci */ 212561847f8eSopenharmony_ci /** 212661847f8eSopenharmony_ci * Sets the volume. 212761847f8eSopenharmony_ci * @param { number } volume - Relative volume. The value ranges from 0.00 to 1.00. The value 1 indicates the maximum volume (100%). 212861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 212961847f8eSopenharmony_ci * @crossplatform 213061847f8eSopenharmony_ci * @atomicservice 213161847f8eSopenharmony_ci * @since 12 213261847f8eSopenharmony_ci */ 213361847f8eSopenharmony_ci setVolume(volume: number): void; 213461847f8eSopenharmony_ci 213561847f8eSopenharmony_ci /** 213661847f8eSopenharmony_ci * Get all track infos in MediaDescription, should be called after data loaded callback. 213761847f8eSopenharmony_ci * @param { AsyncCallback<Array<MediaDescription>> } callback - Async callback return track info in MediaDescription. 213861847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 213961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 214061847f8eSopenharmony_ci * @since 9 214161847f8eSopenharmony_ci */ 214261847f8eSopenharmony_ci /** 214361847f8eSopenharmony_ci * Get all track infos in MediaDescription, should be called after data loaded callback. 214461847f8eSopenharmony_ci * @param { AsyncCallback<Array<MediaDescription>> } callback - Async callback return track info in MediaDescription. 214561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 214661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 214761847f8eSopenharmony_ci * @atomicservice 214861847f8eSopenharmony_ci * @since 11 214961847f8eSopenharmony_ci */ 215061847f8eSopenharmony_ci /** 215161847f8eSopenharmony_ci * Get all track infos in MediaDescription, should be called after data loaded callback. 215261847f8eSopenharmony_ci * @param { AsyncCallback<Array<MediaDescription>> } callback - Async callback return track info in MediaDescription. 215361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 215461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 215561847f8eSopenharmony_ci * @crossplatform 215661847f8eSopenharmony_ci * @atomicservice 215761847f8eSopenharmony_ci * @since 12 215861847f8eSopenharmony_ci */ 215961847f8eSopenharmony_ci getTrackDescription(callback: AsyncCallback<Array<MediaDescription>>): void; 216061847f8eSopenharmony_ci 216161847f8eSopenharmony_ci /** 216261847f8eSopenharmony_ci * Get all track infos in MediaDescription, should be called after data loaded callback. 216361847f8eSopenharmony_ci * @returns { Promise<Array<MediaDescription>> } A Promise instance used to return the track info in MediaDescription. 216461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 216561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 216661847f8eSopenharmony_ci * @since 9 216761847f8eSopenharmony_ci */ 216861847f8eSopenharmony_ci /** 216961847f8eSopenharmony_ci * Get all track infos in MediaDescription, should be called after data loaded callback. 217061847f8eSopenharmony_ci * @returns { Promise<Array<MediaDescription>> } A Promise instance used to return the track info in MediaDescription. 217161847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 217261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 217361847f8eSopenharmony_ci * @atomicservice 217461847f8eSopenharmony_ci * @since 11 217561847f8eSopenharmony_ci */ 217661847f8eSopenharmony_ci /** 217761847f8eSopenharmony_ci * Get all track infos in MediaDescription, should be called after data loaded callback. 217861847f8eSopenharmony_ci * @returns { Promise<Array<MediaDescription>> } A Promise instance used to return the track info in MediaDescription. 217961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 218061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 218161847f8eSopenharmony_ci * @crossplatform 218261847f8eSopenharmony_ci * @atomicservice 218361847f8eSopenharmony_ci * @since 12 218461847f8eSopenharmony_ci */ 218561847f8eSopenharmony_ci getTrackDescription(): Promise<Array<MediaDescription>>; 218661847f8eSopenharmony_ci 218761847f8eSopenharmony_ci /** 218861847f8eSopenharmony_ci * Get selected tracks, should be called after prepared state. 218961847f8eSopenharmony_ci * @returns { Promise<Array<number>> } A Promise instance used to return selected track index. 219061847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 219161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 219261847f8eSopenharmony_ci * @atomicservice 219361847f8eSopenharmony_ci * @since 12 219461847f8eSopenharmony_ci */ 219561847f8eSopenharmony_ci getSelectedTracks(): Promise<Array<number>>; 219661847f8eSopenharmony_ci 219761847f8eSopenharmony_ci /** 219861847f8eSopenharmony_ci * Select specific track to play. 219961847f8eSopenharmony_ci * @param { number } index - Track index returned by getTrackDescription#MD_KEY_TRACK_INDEX 220061847f8eSopenharmony_ci * @param { SwitchMode } mode - set switchmode for track select behavior. 220161847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when select track completed. 220261847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Return by promise. 220361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 220461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 220561847f8eSopenharmony_ci * @atomicservice 220661847f8eSopenharmony_ci * @since 12 220761847f8eSopenharmony_ci */ 220861847f8eSopenharmony_ci selectTrack(index: number, mode?: SwitchMode): Promise<void>; 220961847f8eSopenharmony_ci 221061847f8eSopenharmony_ci /** 221161847f8eSopenharmony_ci * Deselect specific track to play. 221261847f8eSopenharmony_ci * @param { number } index : Track index returned by getTrackDescription#MD_KEY_TRACK_INDEX 221361847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when deselect track completed. 221461847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Return by promise. 221561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 221661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 221761847f8eSopenharmony_ci * @atomicservice 221861847f8eSopenharmony_ci * @since 12 221961847f8eSopenharmony_ci */ 222061847f8eSopenharmony_ci deselectTrack(index: number): Promise<void>; 222161847f8eSopenharmony_ci 222261847f8eSopenharmony_ci /** 222361847f8eSopenharmony_ci * Set MediaSource to AVPlayer, this interface is exclusive with fd/url/dataSrc assign. 222461847f8eSopenharmony_ci * @param { MediaSource } src : MediaSource instance to be set to the avplayer instance. 222561847f8eSopenharmony_ci * @param { PlaybackStrategy } strategy : Play strategy of the media source. 222661847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when setMediaSource completed. 222761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 222861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 222961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 223061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 223161847f8eSopenharmony_ci * @atomicservice 223261847f8eSopenharmony_ci * @since 12 223361847f8eSopenharmony_ci */ 223461847f8eSopenharmony_ci setMediaSource(src: MediaSource, strategy?: PlaybackStrategy): Promise<void>; 223561847f8eSopenharmony_ci 223661847f8eSopenharmony_ci /** 223761847f8eSopenharmony_ci * Add subtitle resource represented by FD to the player. 223861847f8eSopenharmony_ci * @param { number } fd : The file descriptor of subtitle source from file system. 223961847f8eSopenharmony_ci * The caller is responsible to close the file descriptor. 224061847f8eSopenharmony_ci * @param { number } offset : The offset into the file where the data to be read, in bytes. 224161847f8eSopenharmony_ci * By default, the offset is zero. 224261847f8eSopenharmony_ci * @param { number } length : The length in bytes of the data to be read. 224361847f8eSopenharmony_ci * By default, the length is the rest of bytes in the file from the offset. 224461847f8eSopenharmony_ci * @returns { Promise<void> } Promise used to return the result. 224561847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Return by promise. 224661847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 224761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 224861847f8eSopenharmony_ci * @atomicservice 224961847f8eSopenharmony_ci * @since 12 225061847f8eSopenharmony_ci */ 225161847f8eSopenharmony_ci addSubtitleFromFd(fd: number, offset?: number, length?: number): Promise<void>; 225261847f8eSopenharmony_ci 225361847f8eSopenharmony_ci /** 225461847f8eSopenharmony_ci * Add subtitle resource represented by url to the player. After the Promise returns, 225561847f8eSopenharmony_ci * subtitle info can be obtained by @getTrackDescription 225661847f8eSopenharmony_ci * @param { string } url : Address of external subtitle file. 225761847f8eSopenharmony_ci * @returns { Promise<void> } Promise used to return the result. 225861847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Return by promise. 225961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 226061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 226161847f8eSopenharmony_ci * @atomicservice 226261847f8eSopenharmony_ci * @since 12 226361847f8eSopenharmony_ci */ 226461847f8eSopenharmony_ci addSubtitleFromUrl(url: string): Promise<void>; 226561847f8eSopenharmony_ci 226661847f8eSopenharmony_ci /** 226761847f8eSopenharmony_ci * Get statistic infos of current player. 226861847f8eSopenharmony_ci * @returns { Promise<PlaybackInfo> } Statistic infos of current player. 226961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 227061847f8eSopenharmony_ci * @since 12 227161847f8eSopenharmony_ci */ 227261847f8eSopenharmony_ci getPlaybackInfo(): Promise<PlaybackInfo>; 227361847f8eSopenharmony_ci 227461847f8eSopenharmony_ci /** 227561847f8eSopenharmony_ci * Set playback strategy to AVPlayer. 227661847f8eSopenharmony_ci * @param { PlaybackStrategy } strategy : specified strategy of the AVPlayer. 227761847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when setPlaybackStrategy completed. 227861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. 227961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 228061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 228161847f8eSopenharmony_ci * @atomicservice 228261847f8eSopenharmony_ci * @since 12 228361847f8eSopenharmony_ci */ 228461847f8eSopenharmony_ci setPlaybackStrategy(strategy: PlaybackStrategy): Promise<void>; 228561847f8eSopenharmony_ci 228661847f8eSopenharmony_ci /** 228761847f8eSopenharmony_ci * Mute specified media stream. 228861847f8eSopenharmony_ci * @param { MediaType } mediaType - specified media Type, see @MediaType.. 228961847f8eSopenharmony_ci * @param { boolean } muted - true for mute, false for unmute. 229061847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when setMediaMuted completed. 229161847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Return by promise. 229261847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 229361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 229461847f8eSopenharmony_ci * @atomicservice 229561847f8eSopenharmony_ci * @since 12 229661847f8eSopenharmony_ci */ 229761847f8eSopenharmony_ci setMediaMuted(mediaType: MediaType, muted: boolean ): Promise<void>; 229861847f8eSopenharmony_ci 229961847f8eSopenharmony_ci /** 230061847f8eSopenharmony_ci * Set playback start position and end position. 230161847f8eSopenharmony_ci * @param { number } startTimeMs - Playback start position, should be in [0, duration), 230261847f8eSopenharmony_ci * -1 means that the start position is not set, 230361847f8eSopenharmony_ci * and the playback will start from 0. 230461847f8eSopenharmony_ci * @param { number } endTimeMs - Playback end position, which should usually be in (startTimeMs, duration], 230561847f8eSopenharmony_ci * -1 means that the end position is not set, 230661847f8eSopenharmony_ci * and the playback will be ended at the end of the stream. 230761847f8eSopenharmony_ci * @param { SeekMode } [mode] - Use the specified seek mode to jump to the playback start position, 230861847f8eSopenharmony_ci * currently support SeekMode.SEEK_PREV_SYNC and SeekMode.SEEK_CLOSEST, 230961847f8eSopenharmony_ci * other values are invalid, the default value is SeekMode.SEEK_PREV_SYNC. 231061847f8eSopenharmony_ci * @returns { Promise<void> } Promise used to return the result. 231161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Called from Non-System applications. Return by promise. 231261847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Return by promise. 231361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 231461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 231561847f8eSopenharmony_ci * @systemapi 231661847f8eSopenharmony_ci * @since 12 231761847f8eSopenharmony_ci */ 231861847f8eSopenharmony_ci setPlaybackRange(startTimeMs: number, endTimeMs: number, mode?: SeekMode) : Promise<void>; 231961847f8eSopenharmony_ci 232061847f8eSopenharmony_ci /** 232161847f8eSopenharmony_ci * Media URI. Mainstream media formats are supported. 232261847f8eSopenharmony_ci * Network:http://xxx 232361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 232461847f8eSopenharmony_ci * @since 9 232561847f8eSopenharmony_ci */ 232661847f8eSopenharmony_ci /** 232761847f8eSopenharmony_ci * Media URI. Mainstream media formats are supported. 232861847f8eSopenharmony_ci * Network:http://xxx 232961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 233061847f8eSopenharmony_ci * @atomicservice 233161847f8eSopenharmony_ci * @since 11 233261847f8eSopenharmony_ci */ 233361847f8eSopenharmony_ci /** 233461847f8eSopenharmony_ci * Media URI. Mainstream media formats are supported. 233561847f8eSopenharmony_ci * Network:http://xxx 233661847f8eSopenharmony_ci * @type { ?string } 233761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 233861847f8eSopenharmony_ci * @crossplatform 233961847f8eSopenharmony_ci * @atomicservice 234061847f8eSopenharmony_ci * @since 12 234161847f8eSopenharmony_ci */ 234261847f8eSopenharmony_ci url?: string; 234361847f8eSopenharmony_ci 234461847f8eSopenharmony_ci /** 234561847f8eSopenharmony_ci * Media file descriptor. Mainstream media formats are supported. 234661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 234761847f8eSopenharmony_ci * @since 9 234861847f8eSopenharmony_ci */ 234961847f8eSopenharmony_ci /** 235061847f8eSopenharmony_ci * Media file descriptor. Mainstream media formats are supported. 235161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 235261847f8eSopenharmony_ci * @atomicservice 235361847f8eSopenharmony_ci * @since 11 235461847f8eSopenharmony_ci */ 235561847f8eSopenharmony_ci /** 235661847f8eSopenharmony_ci * Media file descriptor. Mainstream media formats are supported. 235761847f8eSopenharmony_ci * @type { ?AVFileDescriptor } 235861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 235961847f8eSopenharmony_ci * @crossplatform 236061847f8eSopenharmony_ci * @atomicservice 236161847f8eSopenharmony_ci * @since 12 236261847f8eSopenharmony_ci */ 236361847f8eSopenharmony_ci fdSrc?: AVFileDescriptor; 236461847f8eSopenharmony_ci 236561847f8eSopenharmony_ci /** 236661847f8eSopenharmony_ci * DataSource descriptor. Supports mainstream media formats. 236761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 236861847f8eSopenharmony_ci * @since 10 236961847f8eSopenharmony_ci */ 237061847f8eSopenharmony_ci /** 237161847f8eSopenharmony_ci * DataSource descriptor. Supports mainstream media formats. 237261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 237361847f8eSopenharmony_ci * @atomicservice 237461847f8eSopenharmony_ci * @since 11 237561847f8eSopenharmony_ci */ 237661847f8eSopenharmony_ci /** 237761847f8eSopenharmony_ci * DataSource descriptor. Supports mainstream media formats. 237861847f8eSopenharmony_ci * @type { ?AVDataSrcDescriptor } 237961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 238061847f8eSopenharmony_ci * @crossplatform 238161847f8eSopenharmony_ci * @atomicservice 238261847f8eSopenharmony_ci * @since 12 238361847f8eSopenharmony_ci */ 238461847f8eSopenharmony_ci dataSrc?: AVDataSrcDescriptor; 238561847f8eSopenharmony_ci 238661847f8eSopenharmony_ci /** 238761847f8eSopenharmony_ci * Whether to loop media playback. 238861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 238961847f8eSopenharmony_ci * @since 9 239061847f8eSopenharmony_ci */ 239161847f8eSopenharmony_ci /** 239261847f8eSopenharmony_ci * Whether to loop media playback. 239361847f8eSopenharmony_ci * @type { boolean } 239461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 239561847f8eSopenharmony_ci * @crossplatform 239661847f8eSopenharmony_ci * @atomicservice 239761847f8eSopenharmony_ci * @since 12 239861847f8eSopenharmony_ci */ 239961847f8eSopenharmony_ci loop: boolean; 240061847f8eSopenharmony_ci 240161847f8eSopenharmony_ci /** 240261847f8eSopenharmony_ci * Describes audio interrupt mode, refer to {@link #audio.InterruptMode}. If it is not 240361847f8eSopenharmony_ci * set, the default mode will be used. Set it before calling the {@link #play()} in the 240461847f8eSopenharmony_ci * first time in order for the interrupt mode to become effective thereafter. 240561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 240661847f8eSopenharmony_ci * @since 9 240761847f8eSopenharmony_ci */ 240861847f8eSopenharmony_ci /** 240961847f8eSopenharmony_ci * Describes audio interrupt mode, refer to {@link #audio.InterruptMode}. If it is not 241061847f8eSopenharmony_ci * set, the default mode will be used. Set it before calling the {@link #play()} in the 241161847f8eSopenharmony_ci * first time in order for the interrupt mode to become effective thereafter. 241261847f8eSopenharmony_ci * @type { ?audio.InterruptMode } 241361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 241461847f8eSopenharmony_ci * @atomicservice 241561847f8eSopenharmony_ci * @since 12 241661847f8eSopenharmony_ci */ 241761847f8eSopenharmony_ci audioInterruptMode?: audio.InterruptMode; 241861847f8eSopenharmony_ci 241961847f8eSopenharmony_ci /** 242061847f8eSopenharmony_ci * Describes audio renderer info, refer to {@link #audio.AudioRendererInfo}. Set it before 242161847f8eSopenharmony_ci * calling the {@link #prepare()} in the first time in order for the audio renderer info to 242261847f8eSopenharmony_ci * become effective thereafter. 242361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 242461847f8eSopenharmony_ci * @since 10 242561847f8eSopenharmony_ci */ 242661847f8eSopenharmony_ci /** 242761847f8eSopenharmony_ci * Describes audio renderer info, refer to {@link #audio.AudioRendererInfo}. Set it before 242861847f8eSopenharmony_ci * calling the {@link #prepare()} in the first time in order for the audio renderer info to 242961847f8eSopenharmony_ci * become effective thereafter. 243061847f8eSopenharmony_ci * @type { ?audio.AudioRendererInfo } 243161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 243261847f8eSopenharmony_ci * @atomicservice 243361847f8eSopenharmony_ci * @since 12 243461847f8eSopenharmony_ci */ 243561847f8eSopenharmony_ci audioRendererInfo?: audio.AudioRendererInfo; 243661847f8eSopenharmony_ci 243761847f8eSopenharmony_ci /** 243861847f8eSopenharmony_ci * Obtains the current audio effect mode, refer to {@link #audio.AudioEffectMode}. 243961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 244061847f8eSopenharmony_ci * @since 10 244161847f8eSopenharmony_ci */ 244261847f8eSopenharmony_ci /** 244361847f8eSopenharmony_ci * Obtains the current audio effect mode, refer to {@link #audio.AudioEffectMode}. 244461847f8eSopenharmony_ci * @type { ?audio.AudioEffectMode } 244561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 244661847f8eSopenharmony_ci * @atomicservice 244761847f8eSopenharmony_ci * @since 12 244861847f8eSopenharmony_ci */ 244961847f8eSopenharmony_ci audioEffectMode ?: audio.AudioEffectMode; 245061847f8eSopenharmony_ci 245161847f8eSopenharmony_ci /** 245261847f8eSopenharmony_ci * Current playback position. 245361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 245461847f8eSopenharmony_ci * @since 9 245561847f8eSopenharmony_ci */ 245661847f8eSopenharmony_ci /** 245761847f8eSopenharmony_ci * Current playback position. 245861847f8eSopenharmony_ci * @type { number } 245961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 246061847f8eSopenharmony_ci * @crossplatform 246161847f8eSopenharmony_ci * @atomicservice 246261847f8eSopenharmony_ci * @since 12 246361847f8eSopenharmony_ci */ 246461847f8eSopenharmony_ci readonly currentTime: number; 246561847f8eSopenharmony_ci 246661847f8eSopenharmony_ci /** 246761847f8eSopenharmony_ci * Playback duration, When the data source does not support seek, it returns - 1, such as a live broadcast scenario. 246861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 246961847f8eSopenharmony_ci * @since 9 247061847f8eSopenharmony_ci */ 247161847f8eSopenharmony_ci /** 247261847f8eSopenharmony_ci * Playback duration, When the data source does not support seek, it returns - 1, such as a live broadcast scenario. 247361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 247461847f8eSopenharmony_ci * @atomicservice 247561847f8eSopenharmony_ci * @since 11 247661847f8eSopenharmony_ci */ 247761847f8eSopenharmony_ci /** 247861847f8eSopenharmony_ci * Playback duration, When the data source does not support seek, it returns - 1, such as a live broadcast scenario. 247961847f8eSopenharmony_ci * @type { number } 248061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 248161847f8eSopenharmony_ci * @crossplatform 248261847f8eSopenharmony_ci * @atomicservice 248361847f8eSopenharmony_ci * @since 12 248461847f8eSopenharmony_ci */ 248561847f8eSopenharmony_ci readonly duration: number; 248661847f8eSopenharmony_ci 248761847f8eSopenharmony_ci /** 248861847f8eSopenharmony_ci * Playback state. 248961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 249061847f8eSopenharmony_ci * @since 9 249161847f8eSopenharmony_ci */ 249261847f8eSopenharmony_ci /** 249361847f8eSopenharmony_ci * Playback state. 249461847f8eSopenharmony_ci * @type { AVPlayerState } 249561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 249661847f8eSopenharmony_ci * @crossplatform 249761847f8eSopenharmony_ci * @atomicservice 249861847f8eSopenharmony_ci * @since 12 249961847f8eSopenharmony_ci */ 250061847f8eSopenharmony_ci readonly state: AVPlayerState; 250161847f8eSopenharmony_ci 250261847f8eSopenharmony_ci /** 250361847f8eSopenharmony_ci * Video player will use this id get a surface instance. 250461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 250561847f8eSopenharmony_ci * @since 9 250661847f8eSopenharmony_ci */ 250761847f8eSopenharmony_ci /** 250861847f8eSopenharmony_ci * Video player will use this id get a surface instance. 250961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 251061847f8eSopenharmony_ci * @atomicservice 251161847f8eSopenharmony_ci * @since 11 251261847f8eSopenharmony_ci */ 251361847f8eSopenharmony_ci /** 251461847f8eSopenharmony_ci * Video player will use this id get a surface instance. 251561847f8eSopenharmony_ci * @type { ?string } 251661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 251761847f8eSopenharmony_ci * @crossplatform 251861847f8eSopenharmony_ci * @atomicservice 251961847f8eSopenharmony_ci * @since 12 252061847f8eSopenharmony_ci */ 252161847f8eSopenharmony_ci surfaceId?: string; 252261847f8eSopenharmony_ci 252361847f8eSopenharmony_ci /** 252461847f8eSopenharmony_ci * Video width, valid after prepared. 252561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 252661847f8eSopenharmony_ci * @since 9 252761847f8eSopenharmony_ci */ 252861847f8eSopenharmony_ci /** 252961847f8eSopenharmony_ci * Video width, valid after prepared. 253061847f8eSopenharmony_ci * @type { number } 253161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 253261847f8eSopenharmony_ci * @crossplatform 253361847f8eSopenharmony_ci * @atomicservice 253461847f8eSopenharmony_ci * @since 12 253561847f8eSopenharmony_ci */ 253661847f8eSopenharmony_ci readonly width: number; 253761847f8eSopenharmony_ci 253861847f8eSopenharmony_ci /** 253961847f8eSopenharmony_ci * Video height, valid after prepared. 254061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 254161847f8eSopenharmony_ci * @since 9 254261847f8eSopenharmony_ci */ 254361847f8eSopenharmony_ci /** 254461847f8eSopenharmony_ci * Video height, valid after prepared. 254561847f8eSopenharmony_ci * @type { number } 254661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 254761847f8eSopenharmony_ci * @crossplatform 254861847f8eSopenharmony_ci * @atomicservice 254961847f8eSopenharmony_ci * @since 12 255061847f8eSopenharmony_ci */ 255161847f8eSopenharmony_ci readonly height: number; 255261847f8eSopenharmony_ci 255361847f8eSopenharmony_ci /** 255461847f8eSopenharmony_ci * Video scale type. By default, the {@link #VIDEO_SCALE_TYPE_FIT} will be used, for more 255561847f8eSopenharmony_ci * information, refer to {@link #VideoScaleType} . 255661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 255761847f8eSopenharmony_ci * @since 9 255861847f8eSopenharmony_ci */ 255961847f8eSopenharmony_ci /** 256061847f8eSopenharmony_ci * Video scale type. By default, the {@link #VIDEO_SCALE_TYPE_FIT} will be used, for more 256161847f8eSopenharmony_ci * information, refer to {@link #VideoScaleType} . 256261847f8eSopenharmony_ci * @type { ?VideoScaleType } 256361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 256461847f8eSopenharmony_ci * @crossplatform 256561847f8eSopenharmony_ci * @atomicservice 256661847f8eSopenharmony_ci * @since 12 256761847f8eSopenharmony_ci */ 256861847f8eSopenharmony_ci videoScaleType?: VideoScaleType; 256961847f8eSopenharmony_ci 257061847f8eSopenharmony_ci /** 257161847f8eSopenharmony_ci * Set payback speed. 257261847f8eSopenharmony_ci * @param { PlaybackSpeed } speed - playback speed, see @PlaybackSpeed . 257361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 257461847f8eSopenharmony_ci * @since 9 257561847f8eSopenharmony_ci */ 257661847f8eSopenharmony_ci /** 257761847f8eSopenharmony_ci * Set payback speed. 257861847f8eSopenharmony_ci * @param { PlaybackSpeed } speed - playback speed, see @PlaybackSpeed . 257961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 258061847f8eSopenharmony_ci * @crossplatform 258161847f8eSopenharmony_ci * @atomicservice 258261847f8eSopenharmony_ci * @since 12 258361847f8eSopenharmony_ci */ 258461847f8eSopenharmony_ci setSpeed(speed: PlaybackSpeed): void; 258561847f8eSopenharmony_ci 258661847f8eSopenharmony_ci /** 258761847f8eSopenharmony_ci * select a specified bitrate to playback, only valid for HLS protocol network stream. By default, the 258861847f8eSopenharmony_ci * player will select the appropriate bitrate according to the network connection speed. The 258961847f8eSopenharmony_ci * available bitrate list reported by {@link #on('availableBitrates')}. Set it to select 259061847f8eSopenharmony_ci * a specified bitrate. If the specified bitrate is not in the list of available bitrate, the player 259161847f8eSopenharmony_ci * will select the minimal and closest one from the available bitrate list. 259261847f8eSopenharmony_ci * @param { number } bitrate - the playback bitrate must be expressed in bits per second. 259361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 259461847f8eSopenharmony_ci * @since 9 259561847f8eSopenharmony_ci */ 259661847f8eSopenharmony_ci /** 259761847f8eSopenharmony_ci * select a specified bitrate to playback, only valid for HLS protocol network stream. By default, the 259861847f8eSopenharmony_ci * player will select the appropriate bitrate according to the network connection speed. The 259961847f8eSopenharmony_ci * available bitrate list reported by {@link #on('availableBitrates')}. Set it to select 260061847f8eSopenharmony_ci * a specified bitrate. If the specified bitrate is not in the list of available bitrate, the player 260161847f8eSopenharmony_ci * will select the minimal and closest one from the available bitrate list. 260261847f8eSopenharmony_ci * @param { number } bitrate - the playback bitrate must be expressed in bits per second. 260361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 260461847f8eSopenharmony_ci * @crossplatform 260561847f8eSopenharmony_ci * @atomicservice 260661847f8eSopenharmony_ci * @since 12 260761847f8eSopenharmony_ci */ 260861847f8eSopenharmony_ci setBitrate(bitrate: number): void; 260961847f8eSopenharmony_ci 261061847f8eSopenharmony_ci /** 261161847f8eSopenharmony_ci * Set decryption session to codec module. 261261847f8eSopenharmony_ci * @param { drm.MediaKeySession } mediaKeySession - Handle of MediaKeySession to decrypt encrypted media. 261361847f8eSopenharmony_ci * @param { boolean } secureVideoPath - Secure video path required or not. 261461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 261561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 261661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 261761847f8eSopenharmony_ci * @since 11 261861847f8eSopenharmony_ci */ 261961847f8eSopenharmony_ci /** 262061847f8eSopenharmony_ci * Set decryption session to codec module. 262161847f8eSopenharmony_ci * @param { drm.MediaKeySession } mediaKeySession - Handle of MediaKeySession to decrypt encrypted media. 262261847f8eSopenharmony_ci * @param { boolean } secureVideoPath - Secure video path required or not. 262361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 262461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 262561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 262661847f8eSopenharmony_ci * @atomicservice 262761847f8eSopenharmony_ci * @since 12 262861847f8eSopenharmony_ci */ 262961847f8eSopenharmony_ci setDecryptionConfig(mediaKeySession: drm.MediaKeySession, secureVideoPath: boolean): void; 263061847f8eSopenharmony_ci 263161847f8eSopenharmony_ci /** 263261847f8eSopenharmony_ci * Get media key system info from media source. 263361847f8eSopenharmony_ci * @returns { Array<drm.MediaKeySystemInfo> } MediaKeySystemInfo with PSSH. 263461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 263561847f8eSopenharmony_ci * @since 11 263661847f8eSopenharmony_ci */ 263761847f8eSopenharmony_ci /** 263861847f8eSopenharmony_ci * Get media key system info from media source. 263961847f8eSopenharmony_ci * @returns { Array<drm.MediaKeySystemInfo> } MediaKeySystemInfo with PSSH. 264061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 264161847f8eSopenharmony_ci * @atomicservice 264261847f8eSopenharmony_ci * @since 12 264361847f8eSopenharmony_ci */ 264461847f8eSopenharmony_ci getMediaKeySystemInfos(): Array<drm.MediaKeySystemInfo>; 264561847f8eSopenharmony_ci 264661847f8eSopenharmony_ci /** 264761847f8eSopenharmony_ci * Register listens for mediaKeySystemInfoUpdate events. 264861847f8eSopenharmony_ci * @param { 'mediaKeySystemInfoUpdate' } type - Type of the event to listen for. 264961847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the mediaKeySystemInfoUpdate event. 265061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 265161847f8eSopenharmony_ci * @since 11 265261847f8eSopenharmony_ci */ 265361847f8eSopenharmony_ci /** 265461847f8eSopenharmony_ci * Register listens for mediaKeySystemInfoUpdate events. 265561847f8eSopenharmony_ci * @param { 'mediaKeySystemInfoUpdate' } type - Type of the event to listen for. 265661847f8eSopenharmony_ci * @param { Callback<Array<drm.MediaKeySystemInfo>> } callback - Callback used to listen for the mediaKeySystemInfoUpdate event. 265761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 265861847f8eSopenharmony_ci * @atomicservice 265961847f8eSopenharmony_ci * @since 12 266061847f8eSopenharmony_ci */ 266161847f8eSopenharmony_ci on(type: 'mediaKeySystemInfoUpdate', callback: Callback<Array<drm.MediaKeySystemInfo>>): void; 266261847f8eSopenharmony_ci 266361847f8eSopenharmony_ci /** 266461847f8eSopenharmony_ci * Unregister listens for mediaKeySystemInfoUpdate events. 266561847f8eSopenharmony_ci * @param { 'mediaKeySystemInfoUpdate' } type - Type of the event to listen for. 266661847f8eSopenharmony_ci * @param { function } callback - Callback for event. 266761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 266861847f8eSopenharmony_ci * @since 11 266961847f8eSopenharmony_ci */ 267061847f8eSopenharmony_ci /** 267161847f8eSopenharmony_ci * Unregister listens for mediaKeySystemInfoUpdate events. 267261847f8eSopenharmony_ci * @param { 'mediaKeySystemInfoUpdate' } type - Type of the event to listen for. 267361847f8eSopenharmony_ci * @param { Callback<Array<drm.MediaKeySystemInfo>> } callback - Callback for event. 267461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 267561847f8eSopenharmony_ci * @atomicservice 267661847f8eSopenharmony_ci * @since 12 267761847f8eSopenharmony_ci */ 267861847f8eSopenharmony_ci off(type: 'mediaKeySystemInfoUpdate', callback?: Callback<Array<drm.MediaKeySystemInfo>>): void; 267961847f8eSopenharmony_ci 268061847f8eSopenharmony_ci /** 268161847f8eSopenharmony_ci * Register listens for media playback stateChange event. 268261847f8eSopenharmony_ci * @param { 'stateChange' } type - Type of the playback event to listen for. 268361847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the playback stateChange event. 268461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 268561847f8eSopenharmony_ci * @since 9 268661847f8eSopenharmony_ci */ 268761847f8eSopenharmony_ci /** 268861847f8eSopenharmony_ci * Register listens for media playback stateChange event. 268961847f8eSopenharmony_ci * @param { 'stateChange' } type - Type of the playback event to listen for. 269061847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the playback stateChange event. 269161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 269261847f8eSopenharmony_ci * @atomicservice 269361847f8eSopenharmony_ci * @since 11 269461847f8eSopenharmony_ci */ 269561847f8eSopenharmony_ci /** 269661847f8eSopenharmony_ci * Register listens for media playback stateChange event. 269761847f8eSopenharmony_ci * @param { 'stateChange' } type - Type of the playback event to listen for. 269861847f8eSopenharmony_ci * @param { OnAVPlayerStateChangeHandle } callback - Callback used to listen for the playback stateChange event. 269961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 270061847f8eSopenharmony_ci * @crossplatform 270161847f8eSopenharmony_ci * @atomicservice 270261847f8eSopenharmony_ci * @since 12 270361847f8eSopenharmony_ci */ 270461847f8eSopenharmony_ci on(type: 'stateChange', callback: OnAVPlayerStateChangeHandle): void; 270561847f8eSopenharmony_ci /** 270661847f8eSopenharmony_ci * Unregister listens for media playback stateChange event. 270761847f8eSopenharmony_ci * @param { 'stateChange' } type - Type of the playback event to listen for. 270861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 270961847f8eSopenharmony_ci * @since 9 271061847f8eSopenharmony_ci */ 271161847f8eSopenharmony_ci /** 271261847f8eSopenharmony_ci * Unregister listens for media playback stateChange event. 271361847f8eSopenharmony_ci * @param { 'stateChange' } type - Type of the playback event to listen for. 271461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 271561847f8eSopenharmony_ci * @atomicservice 271661847f8eSopenharmony_ci * @since 11 271761847f8eSopenharmony_ci */ 271861847f8eSopenharmony_ci /** 271961847f8eSopenharmony_ci * Unregister listens for media playback stateChange event. 272061847f8eSopenharmony_ci * @param { 'stateChange' } type - Type of the playback event to listen for. 272161847f8eSopenharmony_ci * @param { OnAVPlayerStateChangeHandle } callback - Callback used to listen for stateChange event 272261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 272361847f8eSopenharmony_ci * @crossplatform 272461847f8eSopenharmony_ci * @atomicservice 272561847f8eSopenharmony_ci * @since 12 272661847f8eSopenharmony_ci */ 272761847f8eSopenharmony_ci off(type: 'stateChange', callback?: OnAVPlayerStateChangeHandle): void; 272861847f8eSopenharmony_ci /** 272961847f8eSopenharmony_ci * Register listens for media playback volumeChange event. 273061847f8eSopenharmony_ci * @param { 'volumeChange' } type - Type of the playback event to listen for. 273161847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback volume event. 273261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 273361847f8eSopenharmony_ci * @since 9 273461847f8eSopenharmony_ci */ 273561847f8eSopenharmony_ci /** 273661847f8eSopenharmony_ci * Register listens for media playback volumeChange event. 273761847f8eSopenharmony_ci * @param { 'volumeChange' } type - Type of the playback event to listen for. 273861847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback volume event. 273961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 274061847f8eSopenharmony_ci * @crossplatform 274161847f8eSopenharmony_ci * @atomicservice 274261847f8eSopenharmony_ci * @since 12 274361847f8eSopenharmony_ci */ 274461847f8eSopenharmony_ci on(type: 'volumeChange', callback: Callback<number>): void; 274561847f8eSopenharmony_ci /** 274661847f8eSopenharmony_ci * Unregister listens for media playback volumeChange event. 274761847f8eSopenharmony_ci * @param { 'volumeChange' } type - Type of the playback event to listen for. 274861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 274961847f8eSopenharmony_ci * @since 9 275061847f8eSopenharmony_ci */ 275161847f8eSopenharmony_ci /** 275261847f8eSopenharmony_ci * Unregister listens for media playback volumeChange event. 275361847f8eSopenharmony_ci * @param { 'volumeChange' } type - Type of the playback event to listen for. 275461847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback volume event. 275561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 275661847f8eSopenharmony_ci * @crossplatform 275761847f8eSopenharmony_ci * @since 12 275861847f8eSopenharmony_ci */ 275961847f8eSopenharmony_ci off(type: 'volumeChange', callback?: Callback<number>): void; 276061847f8eSopenharmony_ci /** 276161847f8eSopenharmony_ci * Register listens for media playback endOfStream event. 276261847f8eSopenharmony_ci * @param { 'endOfStream' } type - Type of the playback event to listen for. 276361847f8eSopenharmony_ci * @param { Callback<void> } callback - Callback used to listen for the playback end of stream. 276461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 276561847f8eSopenharmony_ci * @since 9 276661847f8eSopenharmony_ci */ 276761847f8eSopenharmony_ci /** 276861847f8eSopenharmony_ci * Register listens for media playback endOfStream event. 276961847f8eSopenharmony_ci * @param { 'endOfStream' } type - Type of the playback event to listen for. 277061847f8eSopenharmony_ci * @param { Callback<void> } callback - Callback used to listen for the playback end of stream. 277161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 277261847f8eSopenharmony_ci * @crossplatform 277361847f8eSopenharmony_ci * @atomicservice 277461847f8eSopenharmony_ci * @since 12 277561847f8eSopenharmony_ci */ 277661847f8eSopenharmony_ci on(type: 'endOfStream', callback: Callback<void>): void; 277761847f8eSopenharmony_ci /** 277861847f8eSopenharmony_ci * Unregister listens for media playback endOfStream event. 277961847f8eSopenharmony_ci * @param { 'endOfStream' } type - Type of the playback event to listen for. 278061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 278161847f8eSopenharmony_ci * @since 9 278261847f8eSopenharmony_ci */ 278361847f8eSopenharmony_ci /** 278461847f8eSopenharmony_ci * Unregister listens for media playback endOfStream event. 278561847f8eSopenharmony_ci * @param { 'endOfStream' } type - Type of the playback event to listen for. 278661847f8eSopenharmony_ci * @param { Callback<void> } callback - Callback used to listen for the playback end of stream. 278761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 278861847f8eSopenharmony_ci * @crossplatform 278961847f8eSopenharmony_ci * @since 12 279061847f8eSopenharmony_ci */ 279161847f8eSopenharmony_ci off(type: 'endOfStream', callback?: Callback<void>): void; 279261847f8eSopenharmony_ci /** 279361847f8eSopenharmony_ci * Register listens for media playback seekDone event. 279461847f8eSopenharmony_ci * @param { 'seekDone' } type - Type of the playback event to listen for. 279561847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback seekDone event. 279661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 279761847f8eSopenharmony_ci * @since 9 279861847f8eSopenharmony_ci */ 279961847f8eSopenharmony_ci /** 280061847f8eSopenharmony_ci * Register listens for media playback seekDone event. 280161847f8eSopenharmony_ci * @param { 'seekDone' } type - Type of the playback event to listen for. 280261847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback seekDone event. 280361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 280461847f8eSopenharmony_ci * @atomicservice 280561847f8eSopenharmony_ci * @since 11 280661847f8eSopenharmony_ci */ 280761847f8eSopenharmony_ci /** 280861847f8eSopenharmony_ci * Register listens for media playback seekDone event. 280961847f8eSopenharmony_ci * @param { 'seekDone' } type - Type of the playback event to listen for. 281061847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback seekDone event. 281161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 281261847f8eSopenharmony_ci * @crossplatform 281361847f8eSopenharmony_ci * @atomicservice 281461847f8eSopenharmony_ci * @since 12 281561847f8eSopenharmony_ci */ 281661847f8eSopenharmony_ci on(type: 'seekDone', callback: Callback<number>): void; 281761847f8eSopenharmony_ci /** 281861847f8eSopenharmony_ci * Unregister listens for media playback seekDone event. 281961847f8eSopenharmony_ci * @param { 'seekDone' } type - Type of the playback event to listen for. 282061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 282161847f8eSopenharmony_ci * @since 9 282261847f8eSopenharmony_ci */ 282361847f8eSopenharmony_ci /** 282461847f8eSopenharmony_ci * Unregister listens for media playback seekDone event. 282561847f8eSopenharmony_ci * @param { 'seekDone' } type - Type of the playback event to listen for. 282661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 282761847f8eSopenharmony_ci * @atomicservice 282861847f8eSopenharmony_ci * @since 11 282961847f8eSopenharmony_ci */ 283061847f8eSopenharmony_ci /** 283161847f8eSopenharmony_ci * Unregister listens for media playback seekDone event. 283261847f8eSopenharmony_ci * @param { 'seekDone' } type - Type of the playback event to listen for. 283361847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback seekDone event. 283461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 283561847f8eSopenharmony_ci * @crossplatform 283661847f8eSopenharmony_ci * @atomicservice 283761847f8eSopenharmony_ci * @since 12 283861847f8eSopenharmony_ci */ 283961847f8eSopenharmony_ci off(type: 'seekDone', callback?: Callback<number>): void; 284061847f8eSopenharmony_ci /** 284161847f8eSopenharmony_ci * Register listens for media playback speedDone event. 284261847f8eSopenharmony_ci * @param { 'speedDone' } type - Type of the playback event to listen for. 284361847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback speedDone event. 284461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 284561847f8eSopenharmony_ci * @since 9 284661847f8eSopenharmony_ci */ 284761847f8eSopenharmony_ci /** 284861847f8eSopenharmony_ci * Register listens for media playback speedDone event. 284961847f8eSopenharmony_ci * @param { 'speedDone' } type - Type of the playback event to listen for. 285061847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback speedDone event. 285161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 285261847f8eSopenharmony_ci * @crossplatform 285361847f8eSopenharmony_ci * @atomicservice 285461847f8eSopenharmony_ci * @since 12 285561847f8eSopenharmony_ci */ 285661847f8eSopenharmony_ci on(type: 'speedDone', callback: Callback<number>): void; 285761847f8eSopenharmony_ci /** 285861847f8eSopenharmony_ci * Unregister listens for media playback speedDone event. 285961847f8eSopenharmony_ci * @param { 'speedDone' } type - Type of the playback event to listen for. 286061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 286161847f8eSopenharmony_ci * @since 9 286261847f8eSopenharmony_ci */ 286361847f8eSopenharmony_ci /** 286461847f8eSopenharmony_ci * Unregister listens for media playback speedDone event. 286561847f8eSopenharmony_ci * @param { 'speedDone' } type - Type of the playback event to listen for. 286661847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback speedDone event. 286761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 286861847f8eSopenharmony_ci * @crossplatform 286961847f8eSopenharmony_ci * @since 12 287061847f8eSopenharmony_ci */ 287161847f8eSopenharmony_ci off(type: 'speedDone', callback?: Callback<number>): void; 287261847f8eSopenharmony_ci /** 287361847f8eSopenharmony_ci * Register listens for media playback setBitrateDone event. 287461847f8eSopenharmony_ci * @param { 'bitrateDone' } type - Type of the playback event to listen for. 287561847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback setBitrateDone event. 287661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 287761847f8eSopenharmony_ci * @since 9 287861847f8eSopenharmony_ci */ 287961847f8eSopenharmony_ci /** 288061847f8eSopenharmony_ci * Register listens for media playback setBitrateDone event. 288161847f8eSopenharmony_ci * @param { 'bitrateDone' } type - Type of the playback event to listen for. 288261847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback setBitrateDone event. 288361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 288461847f8eSopenharmony_ci * @atomicservice 288561847f8eSopenharmony_ci * @since 12 288661847f8eSopenharmony_ci */ 288761847f8eSopenharmony_ci on(type: 'bitrateDone', callback: Callback<number>): void; 288861847f8eSopenharmony_ci /** 288961847f8eSopenharmony_ci * Unregister listens for media playback setBitrateDone event. 289061847f8eSopenharmony_ci * @param { 'bitrateDone' } type - Type of the playback event to listen for. 289161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 289261847f8eSopenharmony_ci * @since 9 289361847f8eSopenharmony_ci */ 289461847f8eSopenharmony_ci /** 289561847f8eSopenharmony_ci * Unregister listens for media playback setBitrateDone event. 289661847f8eSopenharmony_ci * @param { 'bitrateDone' } type - Type of the playback event to listen for. 289761847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback setBitrateDone event. 289861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 289961847f8eSopenharmony_ci * @since 12 290061847f8eSopenharmony_ci */ 290161847f8eSopenharmony_ci off(type: 'bitrateDone', callback?: Callback<number>): void; 290261847f8eSopenharmony_ci /** 290361847f8eSopenharmony_ci * Register listens for media playback timeUpdate event. 290461847f8eSopenharmony_ci * @param { 'timeUpdate' } type - Type of the playback event to listen for. 290561847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback timeUpdate event. 290661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 290761847f8eSopenharmony_ci * @since 9 290861847f8eSopenharmony_ci */ 290961847f8eSopenharmony_ci /** 291061847f8eSopenharmony_ci * Register listens for media playback timeUpdate event. 291161847f8eSopenharmony_ci * @param { 'timeUpdate' } type - Type of the playback event to listen for. 291261847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback timeUpdate event. 291361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 291461847f8eSopenharmony_ci * @atomicservice 291561847f8eSopenharmony_ci * @since 11 291661847f8eSopenharmony_ci */ 291761847f8eSopenharmony_ci /** 291861847f8eSopenharmony_ci * Register listens for media playback timeUpdate event. 291961847f8eSopenharmony_ci * @param { 'timeUpdate' } type - Type of the playback event to listen for. 292061847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback timeUpdate event. 292161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 292261847f8eSopenharmony_ci * @crossplatform 292361847f8eSopenharmony_ci * @atomicservice 292461847f8eSopenharmony_ci * @since 12 292561847f8eSopenharmony_ci */ 292661847f8eSopenharmony_ci on(type: 'timeUpdate', callback: Callback<number>): void; 292761847f8eSopenharmony_ci /** 292861847f8eSopenharmony_ci * Unregister listens for media playback timeUpdate event. 292961847f8eSopenharmony_ci * @param { 'timeUpdate' } type - Type of the playback event to listen for. 293061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 293161847f8eSopenharmony_ci * @since 9 293261847f8eSopenharmony_ci */ 293361847f8eSopenharmony_ci /** 293461847f8eSopenharmony_ci * Unregister listens for media playback timeUpdate event. 293561847f8eSopenharmony_ci * @param { 'timeUpdate' } type - Type of the playback event to listen for. 293661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 293761847f8eSopenharmony_ci * @atomicservice 293861847f8eSopenharmony_ci * @since 11 293961847f8eSopenharmony_ci */ 294061847f8eSopenharmony_ci /** 294161847f8eSopenharmony_ci * Unregister listens for media playback timeUpdate event. 294261847f8eSopenharmony_ci * @param { 'timeUpdate' } type - Type of the playback event to listen for. 294361847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback timeUpdate event. 294461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 294561847f8eSopenharmony_ci * @crossplatform 294661847f8eSopenharmony_ci * @atomicservice 294761847f8eSopenharmony_ci * @since 12 294861847f8eSopenharmony_ci */ 294961847f8eSopenharmony_ci off(type: 'timeUpdate', callback?: Callback<number>): void; 295061847f8eSopenharmony_ci /** 295161847f8eSopenharmony_ci * Register listens for media playback durationUpdate event. 295261847f8eSopenharmony_ci * @param { 'durationUpdate' } type - Type of the playback event to listen for. 295361847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback durationUpdate event. 295461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 295561847f8eSopenharmony_ci * @since 9 295661847f8eSopenharmony_ci */ 295761847f8eSopenharmony_ci /** 295861847f8eSopenharmony_ci * Register listens for media playback durationUpdate event. 295961847f8eSopenharmony_ci * @param { 'durationUpdate' } type - Type of the playback event to listen for. 296061847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback durationUpdate event. 296161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 296261847f8eSopenharmony_ci * @crossplatform 296361847f8eSopenharmony_ci * @atomicservice 296461847f8eSopenharmony_ci * @since 12 296561847f8eSopenharmony_ci */ 296661847f8eSopenharmony_ci on(type: 'durationUpdate', callback: Callback<number>): void; 296761847f8eSopenharmony_ci /** 296861847f8eSopenharmony_ci * Unregister listens for media playback durationUpdate event. 296961847f8eSopenharmony_ci * @param { 'durationUpdate' } type - Type of the playback event to listen for. 297061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 297161847f8eSopenharmony_ci * @since 9 297261847f8eSopenharmony_ci */ 297361847f8eSopenharmony_ci /** 297461847f8eSopenharmony_ci * Unregister listens for media playback durationUpdate event. 297561847f8eSopenharmony_ci * @param { 'durationUpdate' } type - Type of the playback event to listen for. 297661847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback durationUpdate event. 297761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 297861847f8eSopenharmony_ci * @crossplatform 297961847f8eSopenharmony_ci * @since 12 298061847f8eSopenharmony_ci */ 298161847f8eSopenharmony_ci off(type: 'durationUpdate', callback?: Callback<number>): void; 298261847f8eSopenharmony_ci 298361847f8eSopenharmony_ci /** 298461847f8eSopenharmony_ci * Register listens for video playback buffering events. 298561847f8eSopenharmony_ci * @param { 'bufferingUpdate' } type - Type of the playback buffering update event to listen for. 298661847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the buffering update event, 298761847f8eSopenharmony_ci * return BufferingInfoType and the value. 298861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 298961847f8eSopenharmony_ci * @since 9 299061847f8eSopenharmony_ci */ 299161847f8eSopenharmony_ci /** 299261847f8eSopenharmony_ci * Register listens for video playback buffering events. 299361847f8eSopenharmony_ci * @param { 'bufferingUpdate' } type - Type of the playback buffering update event to listen for. 299461847f8eSopenharmony_ci * @param { OnBufferingUpdateHandler } callback - Callback used to listen for the buffering update event, 299561847f8eSopenharmony_ci * return BufferingInfoType and the value. 299661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 299761847f8eSopenharmony_ci * @crossplatform 299861847f8eSopenharmony_ci * @atomicservice 299961847f8eSopenharmony_ci * @since 12 300061847f8eSopenharmony_ci */ 300161847f8eSopenharmony_ci on(type: 'bufferingUpdate', callback: OnBufferingUpdateHandler): void; 300261847f8eSopenharmony_ci 300361847f8eSopenharmony_ci /** 300461847f8eSopenharmony_ci * Unregister listens for video playback buffering events. 300561847f8eSopenharmony_ci * @param { 'bufferingUpdate' } type - Type of the playback buffering update event to listen for. 300661847f8eSopenharmony_ci * return BufferingInfoType and the value. 300761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 300861847f8eSopenharmony_ci * @since 9 300961847f8eSopenharmony_ci */ 301061847f8eSopenharmony_ci /** 301161847f8eSopenharmony_ci * Unregister listens for video playback buffering events. 301261847f8eSopenharmony_ci * @param { 'bufferingUpdate' } type - Type of the playback buffering update event to listen for. 301361847f8eSopenharmony_ci * @param { OnBufferingUpdateHandler } callback - Callback used to listen for the buffering update event, 301461847f8eSopenharmony_ci * return BufferingInfoType and the value. 301561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 301661847f8eSopenharmony_ci * @crossplatform 301761847f8eSopenharmony_ci * @atomicservice 301861847f8eSopenharmony_ci * @since 12 301961847f8eSopenharmony_ci */ 302061847f8eSopenharmony_ci off(type: 'bufferingUpdate', callback?: OnBufferingUpdateHandler): void; 302161847f8eSopenharmony_ci /** 302261847f8eSopenharmony_ci * Register listens for start render video frame events. 302361847f8eSopenharmony_ci * @param { 'startRenderFrame' } type - Type of the playback event to listen for. 302461847f8eSopenharmony_ci * @param { Callback<void> } callback - Callback used to listen for the playback event return . 302561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 302661847f8eSopenharmony_ci * @since 9 302761847f8eSopenharmony_ci */ 302861847f8eSopenharmony_ci /** 302961847f8eSopenharmony_ci * Register listens for start render video frame events. 303061847f8eSopenharmony_ci * @param { 'startRenderFrame' } type - Type of the playback event to listen for. 303161847f8eSopenharmony_ci * @param { Callback<void> } callback - Callback used to listen for the playback event return . 303261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 303361847f8eSopenharmony_ci * @atomicservice 303461847f8eSopenharmony_ci * @since 12 303561847f8eSopenharmony_ci */ 303661847f8eSopenharmony_ci on(type: 'startRenderFrame', callback: Callback<void>): void; 303761847f8eSopenharmony_ci /** 303861847f8eSopenharmony_ci * Unregister listens for start render video frame events. 303961847f8eSopenharmony_ci * @param { 'startRenderFrame' } type - Type of the playback event to listen for. 304061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 304161847f8eSopenharmony_ci * @since 9 304261847f8eSopenharmony_ci */ 304361847f8eSopenharmony_ci /** 304461847f8eSopenharmony_ci * Unregister listens for start render video frame events. 304561847f8eSopenharmony_ci * @param { 'startRenderFrame' } type - Type of the playback event to listen for. 304661847f8eSopenharmony_ci * @param { Callback<void> } callback - Callback used to listen for the playback event return . 304761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 304861847f8eSopenharmony_ci * @since 12 304961847f8eSopenharmony_ci */ 305061847f8eSopenharmony_ci off(type: 'startRenderFrame', callback?: Callback<void>): void; 305161847f8eSopenharmony_ci 305261847f8eSopenharmony_ci /** 305361847f8eSopenharmony_ci * Register listens for video size change event. 305461847f8eSopenharmony_ci * @param { 'videoSizeChange' } type - Type of the playback event to listen for. 305561847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the playback event return video size. 305661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 305761847f8eSopenharmony_ci * @since 9 305861847f8eSopenharmony_ci */ 305961847f8eSopenharmony_ci /** 306061847f8eSopenharmony_ci * Register listens for video size change event. 306161847f8eSopenharmony_ci * @param { 'videoSizeChange' } type - Type of the playback event to listen for. 306261847f8eSopenharmony_ci * @param { OnVideoSizeChangeHandler } callback - Callback used to listen for the playback event return video size. 306361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 306461847f8eSopenharmony_ci * @crossplatform 306561847f8eSopenharmony_ci * @atomicservice 306661847f8eSopenharmony_ci * @since 12 306761847f8eSopenharmony_ci */ 306861847f8eSopenharmony_ci on(type: 'videoSizeChange', callback: OnVideoSizeChangeHandler): void; 306961847f8eSopenharmony_ci /** 307061847f8eSopenharmony_ci * Unregister listens for video size change event. 307161847f8eSopenharmony_ci * @param { 'videoSizeChange' } type - Type of the playback event to listen for. 307261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 307361847f8eSopenharmony_ci * @since 9 307461847f8eSopenharmony_ci */ 307561847f8eSopenharmony_ci /** 307661847f8eSopenharmony_ci * Unregister listens for video size change event. 307761847f8eSopenharmony_ci * @param { 'videoSizeChange' } type - Type of the playback event to listen for. 307861847f8eSopenharmony_ci * @param { OnVideoSizeChangeHandler } callback - Callback used to listen for the playback event return video size. 307961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 308061847f8eSopenharmony_ci * @crossplatform 308161847f8eSopenharmony_ci * @atomicservice 308261847f8eSopenharmony_ci * @since 12 308361847f8eSopenharmony_ci */ 308461847f8eSopenharmony_ci off(type: 'videoSizeChange', callback?: OnVideoSizeChangeHandler): void; 308561847f8eSopenharmony_ci /** 308661847f8eSopenharmony_ci * Register listens for audio interrupt event, refer to {@link #audio.InterruptEvent} 308761847f8eSopenharmony_ci * @param { 'audioInterrupt' } type - Type of the playback event to listen for. 308861847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the playback event return audio interrupt info. 308961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 309061847f8eSopenharmony_ci * @since 9 309161847f8eSopenharmony_ci */ 309261847f8eSopenharmony_ci /** 309361847f8eSopenharmony_ci * Register listens for audio interrupt event, refer to {@link #audio.InterruptEvent} 309461847f8eSopenharmony_ci * @param { 'audioInterrupt' } type - Type of the playback event to listen for. 309561847f8eSopenharmony_ci * @param { Callback<audio.InterruptEvent> } callback - Callback used to listen for the playback event return audio interrupt info. 309661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 309761847f8eSopenharmony_ci * @crossplatform 309861847f8eSopenharmony_ci * @atomicservice 309961847f8eSopenharmony_ci * @since 12 310061847f8eSopenharmony_ci */ 310161847f8eSopenharmony_ci on(type: 'audioInterrupt', callback: Callback<audio.InterruptEvent>): void; 310261847f8eSopenharmony_ci /** 310361847f8eSopenharmony_ci * Unregister listens for audio interrupt event, refer to {@link #audio.InterruptEvent} 310461847f8eSopenharmony_ci * @param { 'audioInterrupt' } type - Type of the playback event to listen for. 310561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 310661847f8eSopenharmony_ci * @since 9 310761847f8eSopenharmony_ci */ 310861847f8eSopenharmony_ci /** 310961847f8eSopenharmony_ci * Unregister listens for audio interrupt event, refer to {@link #audio.InterruptEvent} 311061847f8eSopenharmony_ci * @param { 'audioInterrupt' } type - Type of the playback event to listen for. 311161847f8eSopenharmony_ci * @param { Callback<audio.InterruptEvent> } callback - Callback used to listen for the playback event return audio interrupt info. 311261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 311361847f8eSopenharmony_ci * @crossplatform 311461847f8eSopenharmony_ci * @atomicservice 311561847f8eSopenharmony_ci * @since 12 311661847f8eSopenharmony_ci */ 311761847f8eSopenharmony_ci off(type: 'audioInterrupt', callback?: Callback<audio.InterruptEvent>): void; 311861847f8eSopenharmony_ci /** 311961847f8eSopenharmony_ci * Register listens for available bitrate list collect completed events for HLS protocol stream playback. 312061847f8eSopenharmony_ci * This event will be reported after the {@link #prepare} called. 312161847f8eSopenharmony_ci * @param { 'availableBitrates' } type - Type of the playback event to listen for. 312261847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the playback event return available bitrate list. 312361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 312461847f8eSopenharmony_ci * @since 9 312561847f8eSopenharmony_ci */ 312661847f8eSopenharmony_ci /** 312761847f8eSopenharmony_ci * Register listens for available bitrate list collect completed events for HLS protocol stream playback. 312861847f8eSopenharmony_ci * This event will be reported after the {@link #prepare} called. 312961847f8eSopenharmony_ci * @param { 'availableBitrates' } type - Type of the playback event to listen for. 313061847f8eSopenharmony_ci * @param { Callback<Array<number>> } callback - Callback used to listen for the playback event return available bitrate list. 313161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 313261847f8eSopenharmony_ci * @crossplatform 313361847f8eSopenharmony_ci * @atomicservice 313461847f8eSopenharmony_ci * @since 12 313561847f8eSopenharmony_ci */ 313661847f8eSopenharmony_ci on(type: 'availableBitrates', callback: Callback<Array<number>>): void; 313761847f8eSopenharmony_ci /** 313861847f8eSopenharmony_ci * Unregister listens for available bitrate list collect completed events for HLS protocol stream playback. 313961847f8eSopenharmony_ci * This event will be reported after the {@link #prepare} called. 314061847f8eSopenharmony_ci * @param { 'availableBitrates' } type - Type of the playback event to listen for. 314161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 314261847f8eSopenharmony_ci * @since 9 314361847f8eSopenharmony_ci */ 314461847f8eSopenharmony_ci /** 314561847f8eSopenharmony_ci * Unregister listens for available bitrate list collect completed events for HLS protocol stream playback. 314661847f8eSopenharmony_ci * This event will be reported after the {@link #prepare} called. 314761847f8eSopenharmony_ci * @param { 'availableBitrates' } type - Type of the playback event to listen for. 314861847f8eSopenharmony_ci * @param { Callback<Array<number>> } callback - Callback used to listen for the playback event return available bitrate list. 314961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 315061847f8eSopenharmony_ci * @crossplatform 315161847f8eSopenharmony_ci * @atomicservice 315261847f8eSopenharmony_ci * @since 12 315361847f8eSopenharmony_ci */ 315461847f8eSopenharmony_ci off(type: 'availableBitrates', callback?: Callback<Array<number>>): void; 315561847f8eSopenharmony_ci /** 315661847f8eSopenharmony_ci * Register listens for playback error events. 315761847f8eSopenharmony_ci * @param { 'error' } type - Type of the playback error event to listen for. 315861847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the playback error event. 315961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 316061847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. 316161847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 316261847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. 316361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 316461847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. 316561847f8eSopenharmony_ci * @throws { BusinessError } 5400104 - Time out. 316661847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. 316761847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. 316861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 316961847f8eSopenharmony_ci * @since 9 317061847f8eSopenharmony_ci */ 317161847f8eSopenharmony_ci /** 317261847f8eSopenharmony_ci * Register listens for playback error events. 317361847f8eSopenharmony_ci * @param { 'error' } type - Type of the playback error event to listen for. 317461847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the playback error event. 317561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 317661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 317761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 317861847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 317961847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. 318061847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 318161847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. 318261847f8eSopenharmony_ci * @throws { BusinessError } 5400104 - Time out. 318361847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. 318461847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. 318561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 318661847f8eSopenharmony_ci * @atomicservice 318761847f8eSopenharmony_ci * @since 11 318861847f8eSopenharmony_ci */ 318961847f8eSopenharmony_ci /** 319061847f8eSopenharmony_ci * Register listens for playback error events. 319161847f8eSopenharmony_ci * @param { 'error' } type - Type of the playback error event to listen for. 319261847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the playback error event. 319361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 319461847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. 319561847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 319661847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. 319761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 319861847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. 319961847f8eSopenharmony_ci * @throws { BusinessError } 5400104 - Time out. 320061847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. 320161847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupport format. 320261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 320361847f8eSopenharmony_ci * @crossplatform 320461847f8eSopenharmony_ci * @atomicservice 320561847f8eSopenharmony_ci * @since 12 320661847f8eSopenharmony_ci */ 320761847f8eSopenharmony_ci /** 320861847f8eSopenharmony_ci * Register listens for playback error events. 320961847f8eSopenharmony_ci * @param { 'error' } type - Type of the playback error event to listen for. 321061847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the playback error event. 321161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 321261847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. 321361847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 321461847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. 321561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 321661847f8eSopenharmony_ci * @throws { BusinessError } 5400104 - Time out. 321761847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. 321861847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupport format. 321961847f8eSopenharmony_ci * @throws { BusinessError } 5411001 - IO can not find host. 322061847f8eSopenharmony_ci * @throws { BusinessError } 5411002 - IO connection timeout. 322161847f8eSopenharmony_ci * @throws { BusinessError } 5411003 - IO network abnormal. 322261847f8eSopenharmony_ci * @throws { BusinessError } 5411004 - IO network unavailable. 322361847f8eSopenharmony_ci * @throws { BusinessError } 5411005 - IO no permission. 322461847f8eSopenharmony_ci * @throws { BusinessError } 5411006 - IO request denied. 322561847f8eSopenharmony_ci * @throws { BusinessError } 5411007 - IO resource not found. 322661847f8eSopenharmony_ci * @throws { BusinessError } 5411008 - IO SSL client cert needed. 322761847f8eSopenharmony_ci * @throws { BusinessError } 5411009 - IO SSL connect fail. 322861847f8eSopenharmony_ci * @throws { BusinessError } 5411010 - IO SSL server cert untrusted. 322961847f8eSopenharmony_ci * @throws { BusinessError } 5411011 - IO unsupported request. 323061847f8eSopenharmony_ci * @throws { BusinessError } 5411012 - IO data abnormal. 323161847f8eSopenharmony_ci * @throws { BusinessError } 5411013 - IO file access denied. 323261847f8eSopenharmony_ci * @throws { BusinessError } 5411014 - IO file bad handle. 323361847f8eSopenharmony_ci * @throws { BusinessError } 5411015 - IO file not found. 323461847f8eSopenharmony_ci * @throws { BusinessError } 5411016 - IO file permission denied. 323561847f8eSopenharmony_ci * @throws { BusinessError } 5411017 - IO decode failed. 323661847f8eSopenharmony_ci * @throws { BusinessError } 5411018 - Audio decode init failed. 323761847f8eSopenharmony_ci * @throws { BusinessError } 5411019 - Audio decode unavailable. 323861847f8eSopenharmony_ci * @throws { BusinessError } 5411020 - Audio device error. 323961847f8eSopenharmony_ci * @throws { BusinessError } 5411021 - Audio device invalid state. 324061847f8eSopenharmony_ci * @throws { BusinessError } 5411022 - Audio device timeout. 324161847f8eSopenharmony_ci * @throws { BusinessError } 5411023 - Audio device unavailable. 324261847f8eSopenharmony_ci * @throws { BusinessError } 5411024 - Audio encode failed. 324361847f8eSopenharmony_ci * @throws { BusinessError } 5411025 - Audio encode init failed. 324461847f8eSopenharmony_ci * @throws { BusinessError } 5411026 - Audio encode unavailable. 324561847f8eSopenharmony_ci * @throws { BusinessError } 5411027 - Video decode failed. 324661847f8eSopenharmony_ci * @throws { BusinessError } 5411028 - Video decode init failed. 324761847f8eSopenharmony_ci * @throws { BusinessError } 5411029 - Video decode unavailable. 324861847f8eSopenharmony_ci * @throws { BusinessError } 5411030 - Video device error. 324961847f8eSopenharmony_ci * @throws { BusinessError } 5411031 - Video encode failed. 325061847f8eSopenharmony_ci * @throws { BusinessError } 5411032 - Video encode init failed. 325161847f8eSopenharmony_ci * @throws { BusinessError } 5411033 - Video encode unavailable. 325261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 325361847f8eSopenharmony_ci * @crossplatform 325461847f8eSopenharmony_ci * @atomicservice 325561847f8eSopenharmony_ci * @since 14 325661847f8eSopenharmony_ci */ 325761847f8eSopenharmony_ci on(type: 'error', callback: ErrorCallback): void; 325861847f8eSopenharmony_ci /** 325961847f8eSopenharmony_ci * Unregister listens for playback error events. 326061847f8eSopenharmony_ci * @param { 'error' } type - Type of the playback error event to listen for. 326161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 326261847f8eSopenharmony_ci * @since 9 326361847f8eSopenharmony_ci */ 326461847f8eSopenharmony_ci /** 326561847f8eSopenharmony_ci * Unregister listens for playback error events. 326661847f8eSopenharmony_ci * @param { 'error' } type - Type of the playback error event to listen for. 326761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 326861847f8eSopenharmony_ci * @atomicservice 326961847f8eSopenharmony_ci * @since 11 327061847f8eSopenharmony_ci */ 327161847f8eSopenharmony_ci /** 327261847f8eSopenharmony_ci * Unregister listens for playback error events. 327361847f8eSopenharmony_ci * @param { 'error' } type - Type of the playback error event to listen for. 327461847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the playback error event. 327561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 327661847f8eSopenharmony_ci * @crossplatform 327761847f8eSopenharmony_ci * @atomicservice 327861847f8eSopenharmony_ci * @since 12 327961847f8eSopenharmony_ci */ 328061847f8eSopenharmony_ci off(type: 'error', callback?: ErrorCallback): void; 328161847f8eSopenharmony_ci 328261847f8eSopenharmony_ci /** 328361847f8eSopenharmony_ci * Subscribes output device change event callback. 328461847f8eSopenharmony_ci * The event is triggered when output device change for this stream. 328561847f8eSopenharmony_ci * @param { 'audioOutputDeviceChangeWithInfo' } type - Type of the event to listen for. 328661847f8eSopenharmony_ci * @param { Callback<audio.AudioStreamDeviceChangeInfo> } callback - Callback used to listen device change event. 328761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 328861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 328961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 329061847f8eSopenharmony_ci * @since 11 329161847f8eSopenharmony_ci */ 329261847f8eSopenharmony_ci /** 329361847f8eSopenharmony_ci * Subscribes output device change event callback. 329461847f8eSopenharmony_ci * The event is triggered when output device change for this stream. 329561847f8eSopenharmony_ci * @param { 'audioOutputDeviceChangeWithInfo' } type - Type of the event to listen for. 329661847f8eSopenharmony_ci * @param { Callback<audio.AudioStreamDeviceChangeInfo> } callback - Callback used to listen device change event. 329761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 329861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 329961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 330061847f8eSopenharmony_ci * @atomicservice 330161847f8eSopenharmony_ci * @since 12 330261847f8eSopenharmony_ci */ 330361847f8eSopenharmony_ci on(type: 'audioOutputDeviceChangeWithInfo', callback: Callback<audio.AudioStreamDeviceChangeInfo>): void; 330461847f8eSopenharmony_ci 330561847f8eSopenharmony_ci /** 330661847f8eSopenharmony_ci * Unsubscribes output device change event callback. 330761847f8eSopenharmony_ci * @param { 'audioOutputDeviceChangeWithInfo' } type - Type of the event to listen for. 330861847f8eSopenharmony_ci * @param { Callback<audio.AudioStreamDeviceChangeInfo> } callback - Callback used to listen device change event. 330961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 331061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 331161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 331261847f8eSopenharmony_ci * @since 11 331361847f8eSopenharmony_ci */ 331461847f8eSopenharmony_ci /** 331561847f8eSopenharmony_ci * Unsubscribes output device change event callback. 331661847f8eSopenharmony_ci * @param { 'audioOutputDeviceChangeWithInfo' } type - Type of the event to listen for. 331761847f8eSopenharmony_ci * @param { Callback<audio.AudioStreamDeviceChangeInfo> } callback - Callback used to listen device change event. 331861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 331961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 332061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 332161847f8eSopenharmony_ci * @atomicservice 332261847f8eSopenharmony_ci * @since 12 332361847f8eSopenharmony_ci */ 332461847f8eSopenharmony_ci off(type: 'audioOutputDeviceChangeWithInfo', callback?: Callback<audio.AudioStreamDeviceChangeInfo>): void; 332561847f8eSopenharmony_ci 332661847f8eSopenharmony_ci /** 332761847f8eSopenharmony_ci * Subscribes listener for subtitle update event. 332861847f8eSopenharmony_ci * @param { 'subtitleUpdate' } type - Type of the event to listen for. 332961847f8eSopenharmony_ci * @param { Callback<SubtitleInfo> } callback - Callback used to listen subtitle update event. 333061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 333161847f8eSopenharmony_ci * @atomicservice 333261847f8eSopenharmony_ci * @since 12 333361847f8eSopenharmony_ci */ 333461847f8eSopenharmony_ci on(type: 'subtitleUpdate', callback: Callback<SubtitleInfo>): void 333561847f8eSopenharmony_ci 333661847f8eSopenharmony_ci /** 333761847f8eSopenharmony_ci * Unsubscribes listener for subtitle update event. 333861847f8eSopenharmony_ci * @param { 'subtitleUpdate' } type - Type of the event to listen for. 333961847f8eSopenharmony_ci * @param { Callback<SubtitleInfo> } callback - Callback used to listen subtitle update event. 334061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 334161847f8eSopenharmony_ci * @atomicservice 334261847f8eSopenharmony_ci * @since 12 334361847f8eSopenharmony_ci */ 334461847f8eSopenharmony_ci off(type: 'subtitleUpdate', callback?: Callback<SubtitleInfo>): void 334561847f8eSopenharmony_ci 334661847f8eSopenharmony_ci /** 334761847f8eSopenharmony_ci * Subscribes listener for track change event. 334861847f8eSopenharmony_ci * @param { 'trackChange' } type - Type of the event to listen for. 334961847f8eSopenharmony_ci * @param { OnTrackChangeHandler } callback - Callback used to listen track change event. 335061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 335161847f8eSopenharmony_ci * @atomicservice 335261847f8eSopenharmony_ci * @since 12 335361847f8eSopenharmony_ci */ 335461847f8eSopenharmony_ci on(type: 'trackChange', callback: OnTrackChangeHandler): void 335561847f8eSopenharmony_ci 335661847f8eSopenharmony_ci /** 335761847f8eSopenharmony_ci * Unsubscribes listener for track change event. 335861847f8eSopenharmony_ci * @param { 'trackChange' } type - Type of the event to listen for. 335961847f8eSopenharmony_ci * @param { OnTrackChangeHandler } callback - Callback used to listen track change event. 336061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 336161847f8eSopenharmony_ci * @atomicservice 336261847f8eSopenharmony_ci * @since 12 336361847f8eSopenharmony_ci */ 336461847f8eSopenharmony_ci off(type: 'trackChange', callback?: OnTrackChangeHandler): void 336561847f8eSopenharmony_ci 336661847f8eSopenharmony_ci /** 336761847f8eSopenharmony_ci * Subscribes listener for trackinfo update event. 336861847f8eSopenharmony_ci * @param { 'trackInfoUpdate' } type - Type of the event to listen for. 336961847f8eSopenharmony_ci * @param { Callback<Array<MediaDescription>> } callback - Callback used to listen trackinfo update event. 337061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 337161847f8eSopenharmony_ci * @atomicservice 337261847f8eSopenharmony_ci * @since 12 337361847f8eSopenharmony_ci */ 337461847f8eSopenharmony_ci on(type: 'trackInfoUpdate', callback: Callback<Array<MediaDescription>>): void 337561847f8eSopenharmony_ci 337661847f8eSopenharmony_ci /** 337761847f8eSopenharmony_ci * Unsubscribes listener for trackinfo update event. 337861847f8eSopenharmony_ci * @param { 'trackInfoUpdate' } type - Type of the event to listen for. 337961847f8eSopenharmony_ci * @param { Callback<Array<MediaDescription>> } callback - Callback used to listen trackinfo update event. 338061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 338161847f8eSopenharmony_ci * @atomicservice 338261847f8eSopenharmony_ci * @since 12 338361847f8eSopenharmony_ci */ 338461847f8eSopenharmony_ci off(type: 'trackInfoUpdate', callback?: Callback<Array<MediaDescription>>): void 338561847f8eSopenharmony_ci 338661847f8eSopenharmony_ci /** 338761847f8eSopenharmony_ci * Subscrips listener for audio playback amplitude update event. 338861847f8eSopenharmony_ci * In each event, an array of amplitude is reported, large index indicates closer to current time. 338961847f8eSopenharmony_ci * @param { 'amplitudeUpdate' } type - Type of the event to listen for. 339061847f8eSopenharmony_ci * @param { Callback<Array<Number>> } callback - Callback used to listen amplitude update event. 339161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 339261847f8eSopenharmony_ci * @since 13 339361847f8eSopenharmony_ci */ 339461847f8eSopenharmony_ci on(type: 'amplitudeUpdate', callback: Callback<Array<Number>>): void 339561847f8eSopenharmony_ci 339661847f8eSopenharmony_ci /** 339761847f8eSopenharmony_ci * UnSubscrips listener for audio playback amplitude update event 339861847f8eSopenharmony_ci * @param { 'amplitudeUpdate' } type - Type of the event to listen for. 339961847f8eSopenharmony_ci * @param { Callback<Array<Number>> } callback - Callback used to listen amplitude update event. 340061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 340161847f8eSopenharmony_ci * @since 13 340261847f8eSopenharmony_ci */ 340361847f8eSopenharmony_ci off(type: 'amplitudeUpdate', callback?: Callback<Array<Number>>): void 340461847f8eSopenharmony_ci } 340561847f8eSopenharmony_ci 340661847f8eSopenharmony_ci /** 340761847f8eSopenharmony_ci * Provides player statistic info. 340861847f8eSopenharmony_ci * 340961847f8eSopenharmony_ci * @typedef PlaybackInfo 341061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 341161847f8eSopenharmony_ci * @since 12 341261847f8eSopenharmony_ci */ 341361847f8eSopenharmony_ci interface PlaybackInfo { 341461847f8eSopenharmony_ci /** 341561847f8eSopenharmony_ci * key:value pair, key see @PlaybackInfoKey. 341661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 341761847f8eSopenharmony_ci * @since 12 341861847f8eSopenharmony_ci */ 341961847f8eSopenharmony_ci [key:string]: Object; 342061847f8eSopenharmony_ci } 342161847f8eSopenharmony_ci 342261847f8eSopenharmony_ci /** 342361847f8eSopenharmony_ci * Enumerates statistics info keys for player. 342461847f8eSopenharmony_ci * 342561847f8eSopenharmony_ci * @enum { string } 342661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 342761847f8eSopenharmony_ci * @since 12 342861847f8eSopenharmony_ci */ 342961847f8eSopenharmony_ci enum PlaybackInfoKey { 343061847f8eSopenharmony_ci /** 343161847f8eSopenharmony_ci * IP address of current network stream. 343261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 343361847f8eSopenharmony_ci * @since 12 343461847f8eSopenharmony_ci */ 343561847f8eSopenharmony_ci SERVER_IP_ADDRESS = 'server_ip_address', 343661847f8eSopenharmony_ci 343761847f8eSopenharmony_ci /** 343861847f8eSopenharmony_ci * Average download rate during playing except for suspend downloading. 343961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 344061847f8eSopenharmony_ci * @since 12 344161847f8eSopenharmony_ci */ 344261847f8eSopenharmony_ci AVG_DOWNLOAD_RATE = 'average_download_rate', 344361847f8eSopenharmony_ci 344461847f8eSopenharmony_ci /** 344561847f8eSopenharmony_ci * Current download rate of the last second except for suspend downloading. 344661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 344761847f8eSopenharmony_ci * @since 12 344861847f8eSopenharmony_ci */ 344961847f8eSopenharmony_ci DOWNLOAD_RATE = 'download_rate', 345061847f8eSopenharmony_ci 345161847f8eSopenharmony_ci /** 345261847f8eSopenharmony_ci * Boolean value, true for current is downloading, false for suspend downloading. 345361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 345461847f8eSopenharmony_ci * @since 12 345561847f8eSopenharmony_ci */ 345661847f8eSopenharmony_ci IS_DOWNLOADING = 'is_downloading', 345761847f8eSopenharmony_ci 345861847f8eSopenharmony_ci /** 345961847f8eSopenharmony_ci * Cached duration in milliseconds. 346061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 346161847f8eSopenharmony_ci * @since 12 346261847f8eSopenharmony_ci */ 346361847f8eSopenharmony_ci BUFFER_DURATION = 'buffer_duration', 346461847f8eSopenharmony_ci } 346561847f8eSopenharmony_ci 346661847f8eSopenharmony_ci /** 346761847f8eSopenharmony_ci * Enumerates ErrorCode types, return in BusinessError::code 346861847f8eSopenharmony_ci * 346961847f8eSopenharmony_ci * @enum { number } 347061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 347161847f8eSopenharmony_ci * @since 8 347261847f8eSopenharmony_ci * @deprecated since 11 347361847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVErrorCode 347461847f8eSopenharmony_ci */ 347561847f8eSopenharmony_ci enum MediaErrorCode { 347661847f8eSopenharmony_ci /** 347761847f8eSopenharmony_ci * operation success. 347861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 347961847f8eSopenharmony_ci * @since 8 348061847f8eSopenharmony_ci * @deprecated since 11 348161847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVErrorCode#AVERR_OK 348261847f8eSopenharmony_ci */ 348361847f8eSopenharmony_ci MSERR_OK = 0, 348461847f8eSopenharmony_ci 348561847f8eSopenharmony_ci /** 348661847f8eSopenharmony_ci * malloc or new memory failed. maybe system have no memory. 348761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 348861847f8eSopenharmony_ci * @since 8 348961847f8eSopenharmony_ci * @deprecated since 11 349061847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVErrorCode#AVERR_NO_MEMORY 349161847f8eSopenharmony_ci */ 349261847f8eSopenharmony_ci MSERR_NO_MEMORY = 1, 349361847f8eSopenharmony_ci 349461847f8eSopenharmony_ci /** 349561847f8eSopenharmony_ci * no permission for the operation. 349661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 349761847f8eSopenharmony_ci * @since 8 349861847f8eSopenharmony_ci * @deprecated since 11 349961847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVErrorCode#AVERR_OPERATE_NOT_PERMIT 350061847f8eSopenharmony_ci */ 350161847f8eSopenharmony_ci MSERR_OPERATION_NOT_PERMIT = 2, 350261847f8eSopenharmony_ci 350361847f8eSopenharmony_ci /** 350461847f8eSopenharmony_ci * invalid argument. 350561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 350661847f8eSopenharmony_ci * @since 8 350761847f8eSopenharmony_ci * @deprecated since 11 350861847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVErrorCode#AVERR_INVALID_PARAMETER 350961847f8eSopenharmony_ci */ 351061847f8eSopenharmony_ci MSERR_INVALID_VAL = 3, 351161847f8eSopenharmony_ci 351261847f8eSopenharmony_ci /** 351361847f8eSopenharmony_ci * an I/O error occurred. 351461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 351561847f8eSopenharmony_ci * @since 8 351661847f8eSopenharmony_ci * @deprecated since 11 351761847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVErrorCode#AVERR_IO 351861847f8eSopenharmony_ci */ 351961847f8eSopenharmony_ci MSERR_IO = 4, 352061847f8eSopenharmony_ci 352161847f8eSopenharmony_ci /** 352261847f8eSopenharmony_ci * operation time out. 352361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 352461847f8eSopenharmony_ci * @since 8 352561847f8eSopenharmony_ci * @deprecated since 11 352661847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVErrorCode#AVERR_TIMEOUT 352761847f8eSopenharmony_ci */ 352861847f8eSopenharmony_ci MSERR_TIMEOUT = 5, 352961847f8eSopenharmony_ci 353061847f8eSopenharmony_ci /** 353161847f8eSopenharmony_ci * unknown error. 353261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 353361847f8eSopenharmony_ci * @since 8 353461847f8eSopenharmony_ci * @deprecated since 11 353561847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVErrorCode#AVERR_INVALID_PARAMETER 353661847f8eSopenharmony_ci */ 353761847f8eSopenharmony_ci MSERR_UNKNOWN = 6, 353861847f8eSopenharmony_ci 353961847f8eSopenharmony_ci /** 354061847f8eSopenharmony_ci * media service died. 354161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 354261847f8eSopenharmony_ci * @since 8 354361847f8eSopenharmony_ci * @deprecated since 11 354461847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVErrorCode#AVERR_SERVICE_DIED 354561847f8eSopenharmony_ci */ 354661847f8eSopenharmony_ci MSERR_SERVICE_DIED = 7, 354761847f8eSopenharmony_ci 354861847f8eSopenharmony_ci /** 354961847f8eSopenharmony_ci * operation is not permit in current state. 355061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 355161847f8eSopenharmony_ci * @since 8 355261847f8eSopenharmony_ci * @deprecated since 11 355361847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVErrorCode#AVERR_INVALID_PARAMETER 355461847f8eSopenharmony_ci */ 355561847f8eSopenharmony_ci MSERR_INVALID_STATE = 8, 355661847f8eSopenharmony_ci 355761847f8eSopenharmony_ci /** 355861847f8eSopenharmony_ci * operation is not supported in current version. 355961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 356061847f8eSopenharmony_ci * @since 8 356161847f8eSopenharmony_ci * @deprecated since 11 356261847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVErrorCode#AVERR_UNSUPPORT_CAPABILITY 356361847f8eSopenharmony_ci */ 356461847f8eSopenharmony_ci MSERR_UNSUPPORTED = 9, 356561847f8eSopenharmony_ci } 356661847f8eSopenharmony_ci 356761847f8eSopenharmony_ci /** 356861847f8eSopenharmony_ci * Enumerates buffering info type, for network playback. 356961847f8eSopenharmony_ci * 357061847f8eSopenharmony_ci * @enum { number } 357161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 357261847f8eSopenharmony_ci * @since 8 357361847f8eSopenharmony_ci */ 357461847f8eSopenharmony_ci /** 357561847f8eSopenharmony_ci * Enumerates buffering info type, for network playback. 357661847f8eSopenharmony_ci * 357761847f8eSopenharmony_ci * @enum { number } 357861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 357961847f8eSopenharmony_ci * @crossplatform 358061847f8eSopenharmony_ci * @atomicservice 358161847f8eSopenharmony_ci * @since 12 358261847f8eSopenharmony_ci */ 358361847f8eSopenharmony_ci enum BufferingInfoType { 358461847f8eSopenharmony_ci /** 358561847f8eSopenharmony_ci * begin to buffering 358661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 358761847f8eSopenharmony_ci * @since 8 358861847f8eSopenharmony_ci */ 358961847f8eSopenharmony_ci /** 359061847f8eSopenharmony_ci * begin to buffering 359161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 359261847f8eSopenharmony_ci * @crossplatform 359361847f8eSopenharmony_ci * @atomicservice 359461847f8eSopenharmony_ci * @since 12 359561847f8eSopenharmony_ci */ 359661847f8eSopenharmony_ci BUFFERING_START = 1, 359761847f8eSopenharmony_ci 359861847f8eSopenharmony_ci /** 359961847f8eSopenharmony_ci * end to buffering 360061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 360161847f8eSopenharmony_ci * @since 8 360261847f8eSopenharmony_ci */ 360361847f8eSopenharmony_ci /** 360461847f8eSopenharmony_ci * end to buffering 360561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 360661847f8eSopenharmony_ci * @crossplatform 360761847f8eSopenharmony_ci * @atomicservice 360861847f8eSopenharmony_ci * @since 12 360961847f8eSopenharmony_ci */ 361061847f8eSopenharmony_ci BUFFERING_END = 2, 361161847f8eSopenharmony_ci 361261847f8eSopenharmony_ci /** 361361847f8eSopenharmony_ci * buffering percent 361461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 361561847f8eSopenharmony_ci * @since 8 361661847f8eSopenharmony_ci */ 361761847f8eSopenharmony_ci /** 361861847f8eSopenharmony_ci * buffering percent 361961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 362061847f8eSopenharmony_ci * @crossplatform 362161847f8eSopenharmony_ci * @atomicservice 362261847f8eSopenharmony_ci * @since 12 362361847f8eSopenharmony_ci */ 362461847f8eSopenharmony_ci BUFFERING_PERCENT = 3, 362561847f8eSopenharmony_ci 362661847f8eSopenharmony_ci /** 362761847f8eSopenharmony_ci * cached duration in milliseconds 362861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 362961847f8eSopenharmony_ci * @since 8 363061847f8eSopenharmony_ci */ 363161847f8eSopenharmony_ci /** 363261847f8eSopenharmony_ci * cached duration in milliseconds 363361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 363461847f8eSopenharmony_ci * @crossplatform 363561847f8eSopenharmony_ci * @atomicservice 363661847f8eSopenharmony_ci * @since 12 363761847f8eSopenharmony_ci */ 363861847f8eSopenharmony_ci CACHED_DURATION = 4, 363961847f8eSopenharmony_ci } 364061847f8eSopenharmony_ci 364161847f8eSopenharmony_ci /** 364261847f8eSopenharmony_ci * Media source descriptor. User can set media data information 364361847f8eSopenharmony_ci 364461847f8eSopenharmony_ci * @typedef MediaSource 364561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 364661847f8eSopenharmony_ci * @atomicservice 364761847f8eSopenharmony_ci * @since 12 364861847f8eSopenharmony_ci */ 364961847f8eSopenharmony_ci interface MediaSource { 365061847f8eSopenharmony_ci /** 365161847f8eSopenharmony_ci * Set Media Mime Type to help player handle extended Media source. 365261847f8eSopenharmony_ci * @param { AVMimeTypes } mimeType - for MediaSource define. see @ AVMimeTypes. 365361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 365461847f8eSopenharmony_ci * @atomicservice 365561847f8eSopenharmony_ci * @since 12 365661847f8eSopenharmony_ci */ 365761847f8eSopenharmony_ci setMimeType(mimeType: AVMimeTypes): void; 365861847f8eSopenharmony_ci } 365961847f8eSopenharmony_ci 366061847f8eSopenharmony_ci /** 366161847f8eSopenharmony_ci * Enumerates Media Mime types, used for MediaSource define; 366261847f8eSopenharmony_ci * @enum { string } 366361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 366461847f8eSopenharmony_ci * @atomicservice 366561847f8eSopenharmony_ci * @since 12 366661847f8eSopenharmony_ci */ 366761847f8eSopenharmony_ci enum AVMimeTypes { 366861847f8eSopenharmony_ci /** 366961847f8eSopenharmony_ci * Indicate current file is index file for hls Media. 367061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 367161847f8eSopenharmony_ci * @atomicservice 367261847f8eSopenharmony_ci * @since 12 367361847f8eSopenharmony_ci */ 367461847f8eSopenharmony_ci APPLICATION_M3U8 = 'application/m3u8', 367561847f8eSopenharmony_ci } 367661847f8eSopenharmony_ci /** 367761847f8eSopenharmony_ci * Provides preferred playback settings for player. 367861847f8eSopenharmony_ci * 367961847f8eSopenharmony_ci * @typedef PlaybackStrategy 368061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 368161847f8eSopenharmony_ci * @atomicservice 368261847f8eSopenharmony_ci * @since 12 368361847f8eSopenharmony_ci */ 368461847f8eSopenharmony_ci interface PlaybackStrategy { 368561847f8eSopenharmony_ci /** 368661847f8eSopenharmony_ci * Choose a stream with width close to it. 368761847f8eSopenharmony_ci * @type { ?number } 368861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 368961847f8eSopenharmony_ci * @atomicservice 369061847f8eSopenharmony_ci * @since 12 369161847f8eSopenharmony_ci */ 369261847f8eSopenharmony_ci preferredWidth?: number; 369361847f8eSopenharmony_ci /** 369461847f8eSopenharmony_ci * Choose a stream with height close to it. 369561847f8eSopenharmony_ci * @type { ?number } 369661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 369761847f8eSopenharmony_ci * @atomicservice 369861847f8eSopenharmony_ci * @since 12 369961847f8eSopenharmony_ci */ 370061847f8eSopenharmony_ci preferredHeight?: number; 370161847f8eSopenharmony_ci /** 370261847f8eSopenharmony_ci * Choose a preferred buffer duration. 370361847f8eSopenharmony_ci * @type { ?number } 370461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 370561847f8eSopenharmony_ci * @atomicservice 370661847f8eSopenharmony_ci * @since 12 370761847f8eSopenharmony_ci */ 370861847f8eSopenharmony_ci preferredBufferDuration?: number; 370961847f8eSopenharmony_ci 371061847f8eSopenharmony_ci /** 371161847f8eSopenharmony_ci * If true, the player should choose HDR stream if exist. 371261847f8eSopenharmony_ci * @type { ?boolean } 371361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 371461847f8eSopenharmony_ci * @atomicservice 371561847f8eSopenharmony_ci * @since 12 371661847f8eSopenharmony_ci */ 371761847f8eSopenharmony_ci preferredHdr?: boolean; 371861847f8eSopenharmony_ci 371961847f8eSopenharmony_ci /** 372061847f8eSopenharmony_ci * mute the specified media stream when playing. 372161847f8eSopenharmony_ci * @type { ?MediaType } 372261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 372361847f8eSopenharmony_ci * @since 12 372461847f8eSopenharmony_ci */ 372561847f8eSopenharmony_ci mutedMediaType?: MediaType; 372661847f8eSopenharmony_ci 372761847f8eSopenharmony_ci /** 372861847f8eSopenharmony_ci * Audio language. 372961847f8eSopenharmony_ci * @type { ?string } 373061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 373161847f8eSopenharmony_ci * @atomicservice 373261847f8eSopenharmony_ci * @since 13 373361847f8eSopenharmony_ci */ 373461847f8eSopenharmony_ci preferredAudioLanguage?: string; 373561847f8eSopenharmony_ci 373661847f8eSopenharmony_ci /** 373761847f8eSopenharmony_ci * Subtitle language. 373861847f8eSopenharmony_ci * @type { ?string } 373961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 374061847f8eSopenharmony_ci * @atomicservice 374161847f8eSopenharmony_ci * @since 13 374261847f8eSopenharmony_ci */ 374361847f8eSopenharmony_ci preferredSubtitleLanguage?: string; 374461847f8eSopenharmony_ci } 374561847f8eSopenharmony_ci 374661847f8eSopenharmony_ci /** 374761847f8eSopenharmony_ci * Media file descriptor. The caller needs to ensure that the fd is valid and 374861847f8eSopenharmony_ci * the offset and length are correct. 374961847f8eSopenharmony_ci * 375061847f8eSopenharmony_ci * @typedef AVFileDescriptor 375161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 375261847f8eSopenharmony_ci * @since 9 375361847f8eSopenharmony_ci */ 375461847f8eSopenharmony_ci /** 375561847f8eSopenharmony_ci * Media file descriptor. The caller needs to ensure that the fd is valid and 375661847f8eSopenharmony_ci * the offset and length are correct. 375761847f8eSopenharmony_ci * 375861847f8eSopenharmony_ci * @typedef AVFileDescriptor 375961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 376061847f8eSopenharmony_ci * @atomicservice 376161847f8eSopenharmony_ci * @since 11 376261847f8eSopenharmony_ci */ 376361847f8eSopenharmony_ci /** 376461847f8eSopenharmony_ci * Media file descriptor. The caller needs to ensure that the fd is valid and 376561847f8eSopenharmony_ci * the offset and length are correct. 376661847f8eSopenharmony_ci * 376761847f8eSopenharmony_ci * @typedef AVFileDescriptor 376861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 376961847f8eSopenharmony_ci * @crossplatform 377061847f8eSopenharmony_ci * @atomicservice 377161847f8eSopenharmony_ci * @since 12 377261847f8eSopenharmony_ci */ 377361847f8eSopenharmony_ci interface AVFileDescriptor { 377461847f8eSopenharmony_ci /** 377561847f8eSopenharmony_ci * The file descriptor of audio or video source from file system. The caller 377661847f8eSopenharmony_ci * is responsible to close the file descriptor. 377761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 377861847f8eSopenharmony_ci * @since 9 377961847f8eSopenharmony_ci */ 378061847f8eSopenharmony_ci /** 378161847f8eSopenharmony_ci * The file descriptor of audio or video source from file system. The caller 378261847f8eSopenharmony_ci * is responsible to close the file descriptor. 378361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 378461847f8eSopenharmony_ci * @atomicservice 378561847f8eSopenharmony_ci * @since 11 378661847f8eSopenharmony_ci */ 378761847f8eSopenharmony_ci /** 378861847f8eSopenharmony_ci * The file descriptor of audio or video source from file system. The caller 378961847f8eSopenharmony_ci * is responsible to close the file descriptor. 379061847f8eSopenharmony_ci * @type { number } 379161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 379261847f8eSopenharmony_ci * @crossplatform 379361847f8eSopenharmony_ci * @atomicservice 379461847f8eSopenharmony_ci * @since 12 379561847f8eSopenharmony_ci */ 379661847f8eSopenharmony_ci fd: number 379761847f8eSopenharmony_ci 379861847f8eSopenharmony_ci /** 379961847f8eSopenharmony_ci * The offset into the file where the data to be read, in bytes. By default, 380061847f8eSopenharmony_ci * the offset is zero. 380161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 380261847f8eSopenharmony_ci * @since 9 380361847f8eSopenharmony_ci */ 380461847f8eSopenharmony_ci /** 380561847f8eSopenharmony_ci * The offset into the file where the data to be read, in bytes. By default, 380661847f8eSopenharmony_ci * the offset is zero. 380761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 380861847f8eSopenharmony_ci * @atomicservice 380961847f8eSopenharmony_ci * @since 11 381061847f8eSopenharmony_ci */ 381161847f8eSopenharmony_ci /** 381261847f8eSopenharmony_ci * The offset into the file where the data to be read, in bytes. By default, 381361847f8eSopenharmony_ci * the offset is zero. 381461847f8eSopenharmony_ci * @type { ?number } 381561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 381661847f8eSopenharmony_ci * @crossplatform 381761847f8eSopenharmony_ci * @atomicservice 381861847f8eSopenharmony_ci * @since 12 381961847f8eSopenharmony_ci */ 382061847f8eSopenharmony_ci offset?: number 382161847f8eSopenharmony_ci 382261847f8eSopenharmony_ci /** 382361847f8eSopenharmony_ci * The length in bytes of the data to be read. By default, the length is the 382461847f8eSopenharmony_ci * rest of bytes in the file from the offset. 382561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 382661847f8eSopenharmony_ci * @since 9 382761847f8eSopenharmony_ci */ 382861847f8eSopenharmony_ci /** 382961847f8eSopenharmony_ci * The length in bytes of the data to be read. By default, the length is the 383061847f8eSopenharmony_ci * rest of bytes in the file from the offset. 383161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 383261847f8eSopenharmony_ci * @atomicservice 383361847f8eSopenharmony_ci * @since 11 383461847f8eSopenharmony_ci */ 383561847f8eSopenharmony_ci /** 383661847f8eSopenharmony_ci * The length in bytes of the data to be read. By default, the length is the 383761847f8eSopenharmony_ci * rest of bytes in the file from the offset. 383861847f8eSopenharmony_ci * @type { ?number } 383961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 384061847f8eSopenharmony_ci * @crossplatform 384161847f8eSopenharmony_ci * @atomicservice 384261847f8eSopenharmony_ci * @since 12 384361847f8eSopenharmony_ci */ 384461847f8eSopenharmony_ci length?: number 384561847f8eSopenharmony_ci } 384661847f8eSopenharmony_ci 384761847f8eSopenharmony_ci /** 384861847f8eSopenharmony_ci * DataSource descriptor. The caller needs to ensure that the fileSize and 384961847f8eSopenharmony_ci * callback is valid. 385061847f8eSopenharmony_ci * 385161847f8eSopenharmony_ci * @typedef AVDataSrcDescriptor 385261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 385361847f8eSopenharmony_ci * @since 10 385461847f8eSopenharmony_ci */ 385561847f8eSopenharmony_ci /** 385661847f8eSopenharmony_ci * DataSource descriptor. The caller needs to ensure that the fileSize and 385761847f8eSopenharmony_ci * callback is valid. 385861847f8eSopenharmony_ci * 385961847f8eSopenharmony_ci * @typedef AVDataSrcDescriptor 386061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 386161847f8eSopenharmony_ci * @atomicservice 386261847f8eSopenharmony_ci * @since 11 386361847f8eSopenharmony_ci */ 386461847f8eSopenharmony_ci /** 386561847f8eSopenharmony_ci * DataSource descriptor. The caller needs to ensure that the fileSize and 386661847f8eSopenharmony_ci * callback is valid. 386761847f8eSopenharmony_ci * 386861847f8eSopenharmony_ci * @typedef AVDataSrcDescriptor 386961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 387061847f8eSopenharmony_ci * @crossplatform 387161847f8eSopenharmony_ci * @atomicservice 387261847f8eSopenharmony_ci * @since 12 387361847f8eSopenharmony_ci */ 387461847f8eSopenharmony_ci interface AVDataSrcDescriptor { 387561847f8eSopenharmony_ci /** 387661847f8eSopenharmony_ci * Size of the file, -1 means the file size is unknown, in this case, 387761847f8eSopenharmony_ci * seek and setSpeed can't be executed, loop can't be set, and can't replay. 387861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 387961847f8eSopenharmony_ci * @since 10 388061847f8eSopenharmony_ci */ 388161847f8eSopenharmony_ci /** 388261847f8eSopenharmony_ci * Size of the file, -1 means the file size is unknown, in this case, 388361847f8eSopenharmony_ci * seek and setSpeed can't be executed, loop can't be set, and can't replay. 388461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 388561847f8eSopenharmony_ci * @atomicservice 388661847f8eSopenharmony_ci * @since 11 388761847f8eSopenharmony_ci */ 388861847f8eSopenharmony_ci /** 388961847f8eSopenharmony_ci * Size of the file, -1 means the file size is unknown, in this case, 389061847f8eSopenharmony_ci * seek and setSpeed can't be executed, loop can't be set, and can't replay. 389161847f8eSopenharmony_ci * @type { number } 389261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 389361847f8eSopenharmony_ci * @crossplatform 389461847f8eSopenharmony_ci * @atomicservice 389561847f8eSopenharmony_ci * @since 12 389661847f8eSopenharmony_ci */ 389761847f8eSopenharmony_ci fileSize: number; 389861847f8eSopenharmony_ci /** 389961847f8eSopenharmony_ci * Callback function implemented by users, which is used to fill data. 390061847f8eSopenharmony_ci * buffer - The buffer need to fill. 390161847f8eSopenharmony_ci * length - The stream length player want to get. 390261847f8eSopenharmony_ci * pos - The stream position player want get start, and is an optional parameter. 390361847f8eSopenharmony_ci * When fileSize set to -1, this parameter is not used. 390461847f8eSopenharmony_ci * Returns length of the data to be filled. 390561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 390661847f8eSopenharmony_ci * @since 10 390761847f8eSopenharmony_ci */ 390861847f8eSopenharmony_ci /** 390961847f8eSopenharmony_ci * Callback function implemented by users, which is used to fill data. 391061847f8eSopenharmony_ci * buffer - The buffer need to fill. 391161847f8eSopenharmony_ci * length - The stream length player want to get. 391261847f8eSopenharmony_ci * pos - The stream position player want get start, and is an optional parameter. 391361847f8eSopenharmony_ci * When fileSize set to -1, this parameter is not used. 391461847f8eSopenharmony_ci * Returns length of the data to be filled. 391561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 391661847f8eSopenharmony_ci * @atomicservice 391761847f8eSopenharmony_ci * @since 11 391861847f8eSopenharmony_ci */ 391961847f8eSopenharmony_ci /** 392061847f8eSopenharmony_ci * Callback function implemented by users, which is used to fill data. 392161847f8eSopenharmony_ci * buffer - The buffer need to fill. 392261847f8eSopenharmony_ci * length - The stream length player want to get. 392361847f8eSopenharmony_ci * pos - The stream position player want get start, and is an optional parameter. 392461847f8eSopenharmony_ci * When fileSize set to -1, this parameter is not used. 392561847f8eSopenharmony_ci * Returns length of the data to be filled. 392661847f8eSopenharmony_ci * @type { function } 392761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 392861847f8eSopenharmony_ci * @crossplatform 392961847f8eSopenharmony_ci * @atomicservice 393061847f8eSopenharmony_ci * @since 12 393161847f8eSopenharmony_ci */ 393261847f8eSopenharmony_ci callback: (buffer: ArrayBuffer, length: number, pos?: number) => number; 393361847f8eSopenharmony_ci } 393461847f8eSopenharmony_ci 393561847f8eSopenharmony_ci /** 393661847f8eSopenharmony_ci * Provides subtitle information. 393761847f8eSopenharmony_ci * Can be synchronized to the time reported by AVPlayer#timeUpdate event 393861847f8eSopenharmony_ci * 393961847f8eSopenharmony_ci * @typedef SubtitleInfo 394061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 394161847f8eSopenharmony_ci * @atomicservice 394261847f8eSopenharmony_ci * @since 12 394361847f8eSopenharmony_ci */ 394461847f8eSopenharmony_ci interface SubtitleInfo { 394561847f8eSopenharmony_ci /** 394661847f8eSopenharmony_ci * Duration of the text to be displayed, as milliseconds. 394761847f8eSopenharmony_ci * @type { ?number } 394861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 394961847f8eSopenharmony_ci * @atomicservice 395061847f8eSopenharmony_ci * @since 12 395161847f8eSopenharmony_ci */ 395261847f8eSopenharmony_ci duration?: number; 395361847f8eSopenharmony_ci /** 395461847f8eSopenharmony_ci * Display start time of the text, as milliseconds. 395561847f8eSopenharmony_ci * @type { ?number } 395661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 395761847f8eSopenharmony_ci * @atomicservice 395861847f8eSopenharmony_ci * @since 12 395961847f8eSopenharmony_ci */ 396061847f8eSopenharmony_ci startTime?: number; 396161847f8eSopenharmony_ci /** 396261847f8eSopenharmony_ci * Text information of current update event. 396361847f8eSopenharmony_ci * @type { ?string } 396461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 396561847f8eSopenharmony_ci * @atomicservice 396661847f8eSopenharmony_ci * @since 12 396761847f8eSopenharmony_ci */ 396861847f8eSopenharmony_ci text?: string; 396961847f8eSopenharmony_ci } 397061847f8eSopenharmony_ci 397161847f8eSopenharmony_ci /** 397261847f8eSopenharmony_ci * Describes audio playback states. 397361847f8eSopenharmony_ci * @typedef { 'idle' | 'playing' | 'paused' | 'stopped' | 'error' } 397461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 397561847f8eSopenharmony_ci * @since 6 397661847f8eSopenharmony_ci * @deprecated since 9 397761847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayerState 397861847f8eSopenharmony_ci */ 397961847f8eSopenharmony_ci type AudioState = 'idle' | 'playing' | 'paused' | 'stopped' | 'error'; 398061847f8eSopenharmony_ci 398161847f8eSopenharmony_ci /** 398261847f8eSopenharmony_ci * Manages and plays audio. Before calling an AudioPlayer method, you must use createAudioPlayer() 398361847f8eSopenharmony_ci * to create an AudioPlayer instance. 398461847f8eSopenharmony_ci * 398561847f8eSopenharmony_ci * @typedef AudioPlayer 398661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 398761847f8eSopenharmony_ci * @since 6 398861847f8eSopenharmony_ci * @deprecated since 9 398961847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer 399061847f8eSopenharmony_ci */ 399161847f8eSopenharmony_ci interface AudioPlayer { 399261847f8eSopenharmony_ci /** 399361847f8eSopenharmony_ci * Starts audio playback. 399461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 399561847f8eSopenharmony_ci * @since 6 399661847f8eSopenharmony_ci * @deprecated since 9 399761847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#play 399861847f8eSopenharmony_ci */ 399961847f8eSopenharmony_ci play(): void; 400061847f8eSopenharmony_ci 400161847f8eSopenharmony_ci /** 400261847f8eSopenharmony_ci * Pauses audio playback. 400361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 400461847f8eSopenharmony_ci * @since 6 400561847f8eSopenharmony_ci * @deprecated since 9 400661847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#pause 400761847f8eSopenharmony_ci */ 400861847f8eSopenharmony_ci pause(): void; 400961847f8eSopenharmony_ci 401061847f8eSopenharmony_ci /** 401161847f8eSopenharmony_ci * Stops audio playback. 401261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 401361847f8eSopenharmony_ci * @since 6 401461847f8eSopenharmony_ci * @deprecated since 9 401561847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#stop 401661847f8eSopenharmony_ci */ 401761847f8eSopenharmony_ci stop(): void; 401861847f8eSopenharmony_ci 401961847f8eSopenharmony_ci /** 402061847f8eSopenharmony_ci * Resets audio playback. 402161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 402261847f8eSopenharmony_ci * @since 7 402361847f8eSopenharmony_ci * @deprecated since 9 402461847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#reset 402561847f8eSopenharmony_ci */ 402661847f8eSopenharmony_ci reset(): void; 402761847f8eSopenharmony_ci 402861847f8eSopenharmony_ci /** 402961847f8eSopenharmony_ci * Jumps to the specified playback position. 403061847f8eSopenharmony_ci * @param { number } timeMs - Playback position to jump 403161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 403261847f8eSopenharmony_ci * @since 6 403361847f8eSopenharmony_ci * @deprecated since 9 403461847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#seek 403561847f8eSopenharmony_ci */ 403661847f8eSopenharmony_ci seek(timeMs: number): void; 403761847f8eSopenharmony_ci 403861847f8eSopenharmony_ci /** 403961847f8eSopenharmony_ci * Sets the volume. 404061847f8eSopenharmony_ci * @param { number } vol - Relative volume. The value ranges from 0.00 to 1.00. The value 1 indicates the maximum volume (100%). 404161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 404261847f8eSopenharmony_ci * @since 6 404361847f8eSopenharmony_ci * @deprecated since 9 404461847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#setVolume 404561847f8eSopenharmony_ci */ 404661847f8eSopenharmony_ci setVolume(vol: number): void; 404761847f8eSopenharmony_ci 404861847f8eSopenharmony_ci /** 404961847f8eSopenharmony_ci * Releases resources used for audio playback. 405061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 405161847f8eSopenharmony_ci * @since 6 405261847f8eSopenharmony_ci * @deprecated since 9 405361847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#release 405461847f8eSopenharmony_ci */ 405561847f8eSopenharmony_ci release(): void; 405661847f8eSopenharmony_ci 405761847f8eSopenharmony_ci /** 405861847f8eSopenharmony_ci * Get all track infos in MediaDescription, should be called after data loaded callback. 405961847f8eSopenharmony_ci * @param { AsyncCallback<Array<MediaDescription>> } callback - async callback return track info in MediaDescription. 406061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 406161847f8eSopenharmony_ci * @since 8 406261847f8eSopenharmony_ci * @deprecated since 9 406361847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#getTrackDescription 406461847f8eSopenharmony_ci */ 406561847f8eSopenharmony_ci getTrackDescription(callback: AsyncCallback<Array<MediaDescription>>): void; 406661847f8eSopenharmony_ci 406761847f8eSopenharmony_ci /** 406861847f8eSopenharmony_ci * Get all track infos in MediaDescription, should be called after data loaded callback. 406961847f8eSopenharmony_ci * @returns { Promise<Array<MediaDescription>> } A Promise instance used to return the track info in MediaDescription. 407061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 407161847f8eSopenharmony_ci * @since 8 407261847f8eSopenharmony_ci * @deprecated since 9 407361847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#getTrackDescription 407461847f8eSopenharmony_ci */ 407561847f8eSopenharmony_ci getTrackDescription(): Promise<Array<MediaDescription>>; 407661847f8eSopenharmony_ci 407761847f8eSopenharmony_ci /** 407861847f8eSopenharmony_ci * Listens for audio playback buffering events. 407961847f8eSopenharmony_ci * @param { 'bufferingUpdate' } type - Type of the playback buffering update event to listen for. 408061847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the buffering update event, 408161847f8eSopenharmony_ci * return BufferingInfoType and the value. 408261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 408361847f8eSopenharmony_ci * @since 8 408461847f8eSopenharmony_ci * @deprecated since 9 408561847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#event:bufferingUpdate 408661847f8eSopenharmony_ci */ 408761847f8eSopenharmony_ci on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void; 408861847f8eSopenharmony_ci 408961847f8eSopenharmony_ci /** 409061847f8eSopenharmony_ci * Audio media URI. Mainstream audio formats are supported. 409161847f8eSopenharmony_ci * local:fd://XXX, file://XXX. network:http://xxx 409261847f8eSopenharmony_ci * @type { string } 409361847f8eSopenharmony_ci * @permission ohos.permission.READ_MEDIA or ohos.permission.INTERNET 409461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 409561847f8eSopenharmony_ci * @since 6 409661847f8eSopenharmony_ci * @deprecated since 9 409761847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#url 409861847f8eSopenharmony_ci */ 409961847f8eSopenharmony_ci src: string; 410061847f8eSopenharmony_ci 410161847f8eSopenharmony_ci /** 410261847f8eSopenharmony_ci * Audio file descriptor. Mainstream audio formats are supported. 410361847f8eSopenharmony_ci * @type { AVFileDescriptor } 410461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 410561847f8eSopenharmony_ci * @since 9 410661847f8eSopenharmony_ci * @deprecated since 9 410761847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#fdSrc 410861847f8eSopenharmony_ci */ 410961847f8eSopenharmony_ci fdSrc: AVFileDescriptor; 411061847f8eSopenharmony_ci 411161847f8eSopenharmony_ci /** 411261847f8eSopenharmony_ci * Whether to loop audio playback. The value true means to loop playback. 411361847f8eSopenharmony_ci * @type { boolean } 411461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 411561847f8eSopenharmony_ci * @since 6 411661847f8eSopenharmony_ci * @deprecated since 9 411761847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#loop 411861847f8eSopenharmony_ci */ 411961847f8eSopenharmony_ci loop: boolean; 412061847f8eSopenharmony_ci 412161847f8eSopenharmony_ci /** 412261847f8eSopenharmony_ci * Describes audio interrupt mode, refer to {@link #audio.InterruptMode}. If it is not 412361847f8eSopenharmony_ci * set, the default mode will be used. Set it before calling the {@link #play()} in the 412461847f8eSopenharmony_ci * first time in order for the interrupt mode to become effective thereafter. 412561847f8eSopenharmony_ci * @type { ?audio.InterruptMode } 412661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 412761847f8eSopenharmony_ci * @since 9 412861847f8eSopenharmony_ci * @deprecated since 9 412961847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#audioInterruptMode 413061847f8eSopenharmony_ci */ 413161847f8eSopenharmony_ci audioInterruptMode?: audio.InterruptMode; 413261847f8eSopenharmony_ci 413361847f8eSopenharmony_ci /** 413461847f8eSopenharmony_ci * Current playback position. 413561847f8eSopenharmony_ci * @type { number } 413661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 413761847f8eSopenharmony_ci * @since 6 413861847f8eSopenharmony_ci * @deprecated since 9 413961847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#currentTime 414061847f8eSopenharmony_ci */ 414161847f8eSopenharmony_ci readonly currentTime: number; 414261847f8eSopenharmony_ci 414361847f8eSopenharmony_ci /** 414461847f8eSopenharmony_ci * Playback duration, When the data source does not support seek, it returns - 1, such as a live broadcast scenario. 414561847f8eSopenharmony_ci * @type { number } 414661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 414761847f8eSopenharmony_ci * @since 6 414861847f8eSopenharmony_ci * @deprecated since 9 414961847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#duration 415061847f8eSopenharmony_ci */ 415161847f8eSopenharmony_ci readonly duration: number; 415261847f8eSopenharmony_ci 415361847f8eSopenharmony_ci /** 415461847f8eSopenharmony_ci * Playback state. 415561847f8eSopenharmony_ci * @type { AudioState } 415661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 415761847f8eSopenharmony_ci * @since 6 415861847f8eSopenharmony_ci * @deprecated since 9 415961847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#state 416061847f8eSopenharmony_ci */ 416161847f8eSopenharmony_ci readonly state: AudioState; 416261847f8eSopenharmony_ci 416361847f8eSopenharmony_ci /** 416461847f8eSopenharmony_ci * Listens for audio playback events. 416561847f8eSopenharmony_ci * @param { 'play' | 'pause' | 'stop' | 'reset' | 'dataLoad' | 'finish' | 'volumeChange' } type - Type of the playback event to listen for. 416661847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the playback event. 416761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 416861847f8eSopenharmony_ci * @since 6 416961847f8eSopenharmony_ci * @deprecated since 9 417061847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#event:stateChange 417161847f8eSopenharmony_ci */ 417261847f8eSopenharmony_ci on(type: 'play' | 'pause' | 'stop' | 'reset' | 'dataLoad' | 'finish' | 'volumeChange', callback: () => void): void; 417361847f8eSopenharmony_ci 417461847f8eSopenharmony_ci /** 417561847f8eSopenharmony_ci * Listens for audio playback events. 417661847f8eSopenharmony_ci * @param { 'timeUpdate' } type - Type of the playback event to listen for. 417761847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the playback event. 417861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 417961847f8eSopenharmony_ci * @since 6 418061847f8eSopenharmony_ci * @deprecated since 9 418161847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#event:timeUpdate 418261847f8eSopenharmony_ci */ 418361847f8eSopenharmony_ci on(type: 'timeUpdate', callback: Callback<number>): void; 418461847f8eSopenharmony_ci 418561847f8eSopenharmony_ci /** 418661847f8eSopenharmony_ci * Listens for audio interrupt event, refer to {@link #audio.InterruptEvent} 418761847f8eSopenharmony_ci * @param { 'audioInterrupt' } type - Type of the playback event to listen for. 418861847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the playback event return audio interrupt info. 418961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 419061847f8eSopenharmony_ci * @since 9 419161847f8eSopenharmony_ci * @deprecated since 9 419261847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#event:audioInterrupt 419361847f8eSopenharmony_ci */ 419461847f8eSopenharmony_ci on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void; 419561847f8eSopenharmony_ci 419661847f8eSopenharmony_ci /** 419761847f8eSopenharmony_ci * Listens for playback error events. 419861847f8eSopenharmony_ci * @param { 'error' } type - Type of the playback error event to listen for. 419961847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the playback error event. 420061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioPlayer 420161847f8eSopenharmony_ci * @since 6 420261847f8eSopenharmony_ci * @deprecated since 9 420361847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#event:error 420461847f8eSopenharmony_ci */ 420561847f8eSopenharmony_ci on(type: 'error', callback: ErrorCallback): void; 420661847f8eSopenharmony_ci } 420761847f8eSopenharmony_ci 420861847f8eSopenharmony_ci /** 420961847f8eSopenharmony_ci * Describes media recorder states. 421061847f8eSopenharmony_ci * @typedef {'idle' | 'prepared' | 'started' | 'paused' | 'stopped' | 'released' | 'error'} 421161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 421261847f8eSopenharmony_ci * @since 9 421361847f8eSopenharmony_ci */ 421461847f8eSopenharmony_ci /** 421561847f8eSopenharmony_ci * Describes media recorder states. 421661847f8eSopenharmony_ci * @typedef {'idle' | 'prepared' | 'started' | 'paused' | 'stopped' | 'released' | 'error'} 421761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 421861847f8eSopenharmony_ci * @crossplatform 421961847f8eSopenharmony_ci * @atomicservice 422061847f8eSopenharmony_ci * @since 12 422161847f8eSopenharmony_ci */ 422261847f8eSopenharmony_ci type AVRecorderState = 'idle' | 'prepared' | 'started' | 'paused' | 'stopped' | 'released' | 'error'; 422361847f8eSopenharmony_ci 422461847f8eSopenharmony_ci /** 422561847f8eSopenharmony_ci * Defines the onMove callback. 422661847f8eSopenharmony_ci * 422761847f8eSopenharmony_ci * @typedef { function } OnAVRecorderStateChangeHandler 422861847f8eSopenharmony_ci * @param { AVRecorderState } state - state value for AVRecorder. 422961847f8eSopenharmony_ci * @param { StateChangeReason } reason - reason for state change. 423061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVPlayer 423161847f8eSopenharmony_ci * @crossplatform 423261847f8eSopenharmony_ci * @atomicservice 423361847f8eSopenharmony_ci * @since 12 423461847f8eSopenharmony_ci */ 423561847f8eSopenharmony_ci type OnAVRecorderStateChangeHandler = (state: AVRecorderState, reason: StateChangeReason) => void; 423661847f8eSopenharmony_ci 423761847f8eSopenharmony_ci /** 423861847f8eSopenharmony_ci * Manages and record audio/video. Before calling an AVRecorder method, you must use createAVRecorder() 423961847f8eSopenharmony_ci * to create an AVRecorder instance. 424061847f8eSopenharmony_ci * 424161847f8eSopenharmony_ci * @typedef AVRecorder 424261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 424361847f8eSopenharmony_ci * @since 9 424461847f8eSopenharmony_ci */ 424561847f8eSopenharmony_ci /** 424661847f8eSopenharmony_ci * Manages and record audio/video. Before calling an AVRecorder method, you must use createAVRecorder() 424761847f8eSopenharmony_ci * to create an AVRecorder instance. 424861847f8eSopenharmony_ci * 424961847f8eSopenharmony_ci * @typedef AVRecorder 425061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 425161847f8eSopenharmony_ci * @crossplatform 425261847f8eSopenharmony_ci * @atomicservice 425361847f8eSopenharmony_ci * @since 12 425461847f8eSopenharmony_ci */ 425561847f8eSopenharmony_ci interface AVRecorder { 425661847f8eSopenharmony_ci /** 425761847f8eSopenharmony_ci * Prepares for recording. 425861847f8eSopenharmony_ci * @permission ohos.permission.MICROPHONE 425961847f8eSopenharmony_ci * @param { AVRecorderConfig } config - Recording parameters. 426061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when prepare completed. 426161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. Return by callback. 426261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 426361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 426461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. 426561847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 426661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 426761847f8eSopenharmony_ci * @since 9 426861847f8eSopenharmony_ci */ 426961847f8eSopenharmony_ci /** 427061847f8eSopenharmony_ci * Prepares for recording. 427161847f8eSopenharmony_ci * @permission ohos.permission.MICROPHONE 427261847f8eSopenharmony_ci * @param { AVRecorderConfig } config - Recording parameters. 427361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when prepare completed. 427461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. Return by callback. 427561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 427661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 427761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. 427861847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 427961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 428061847f8eSopenharmony_ci * @crossplatform 428161847f8eSopenharmony_ci * @since 12 428261847f8eSopenharmony_ci */ 428361847f8eSopenharmony_ci prepare(config: AVRecorderConfig, callback: AsyncCallback<void>): void; 428461847f8eSopenharmony_ci 428561847f8eSopenharmony_ci /** 428661847f8eSopenharmony_ci * Prepares for recording. 428761847f8eSopenharmony_ci * @permission ohos.permission.MICROPHONE 428861847f8eSopenharmony_ci * @param { AVRecorderConfig } config - Recording parameters. 428961847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when prepare completed. 429061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. Return by promise. 429161847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Return by promise. 429261847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. 429361847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 429461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 429561847f8eSopenharmony_ci * @since 9 429661847f8eSopenharmony_ci */ 429761847f8eSopenharmony_ci /** 429861847f8eSopenharmony_ci * Prepares for recording. 429961847f8eSopenharmony_ci * @permission ohos.permission.MICROPHONE 430061847f8eSopenharmony_ci * @param { AVRecorderConfig } config - Recording parameters. 430161847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when prepare completed. 430261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. Return by promise. 430361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 430461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 430561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. 430661847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 430761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 430861847f8eSopenharmony_ci * @crossplatform 430961847f8eSopenharmony_ci * @atomicservice 431061847f8eSopenharmony_ci * @since 12 431161847f8eSopenharmony_ci */ 431261847f8eSopenharmony_ci prepare(config: AVRecorderConfig): Promise<void>; 431361847f8eSopenharmony_ci 431461847f8eSopenharmony_ci /** 431561847f8eSopenharmony_ci * Get AVRecorderConfig.it must be called after prepare. 431661847f8eSopenharmony_ci * @param { AsyncCallback<AVRecorderConfig> } callback - Callback used to return the input config in AVRecorderConfig. 431761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. 431861847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 431961847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 432061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 432161847f8eSopenharmony_ci * @since 11 432261847f8eSopenharmony_ci */ 432361847f8eSopenharmony_ci getAVRecorderConfig(callback: AsyncCallback<AVRecorderConfig>): void; 432461847f8eSopenharmony_ci 432561847f8eSopenharmony_ci /** 432661847f8eSopenharmony_ci * Get AVRecorderConfig.it must be called after prepare. 432761847f8eSopenharmony_ci * @returns { Promise<AVRecorderConfig> } A Promise instance used to return the input config in AVRecorderConfig. 432861847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. 432961847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 433061847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 433161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 433261847f8eSopenharmony_ci * @since 11 433361847f8eSopenharmony_ci */ 433461847f8eSopenharmony_ci getAVRecorderConfig(): Promise<AVRecorderConfig>; 433561847f8eSopenharmony_ci 433661847f8eSopenharmony_ci /** 433761847f8eSopenharmony_ci * Get input surface.it must be called between prepare completed and start. 433861847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Callback used to return the input surface id in string. 433961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. 434061847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 434161847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 434261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 434361847f8eSopenharmony_ci * @since 9 434461847f8eSopenharmony_ci */ 434561847f8eSopenharmony_ci getInputSurface(callback: AsyncCallback<string>): void; 434661847f8eSopenharmony_ci 434761847f8eSopenharmony_ci /** 434861847f8eSopenharmony_ci * Get input surface. it must be called between prepare completed and start. 434961847f8eSopenharmony_ci * @returns { Promise<string> } A Promise instance used to return the input surface id in string. 435061847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. 435161847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 435261847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 435361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 435461847f8eSopenharmony_ci * @since 9 435561847f8eSopenharmony_ci */ 435661847f8eSopenharmony_ci getInputSurface(): Promise<string>; 435761847f8eSopenharmony_ci 435861847f8eSopenharmony_ci /** 435961847f8eSopenharmony_ci * Get input meta surface for specified meta source type. it must be called between prepare completed and start. 436061847f8eSopenharmony_ci * @param { MetaSourceType } type - Meta source type. 436161847f8eSopenharmony_ci * @returns { Promise<string> } A Promise instance used to return the input surface id in string. 436261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Called from Non-System applications. Return by promise. 436361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 436461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 436561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. 436661847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 436761847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 436861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 436961847f8eSopenharmony_ci * @systemapi 437061847f8eSopenharmony_ci * @since 12 437161847f8eSopenharmony_ci */ 437261847f8eSopenharmony_ci getInputMetaSurface(type: MetaSourceType): Promise<string>; 437361847f8eSopenharmony_ci 437461847f8eSopenharmony_ci /** 437561847f8eSopenharmony_ci * Check if the avrecorder has watermark capability. 437661847f8eSopenharmony_ci * @returns { Promise<boolean> } A Promise instance used to return true or false when the function is finished. 437761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 437861847f8eSopenharmony_ci * @systemapi 437961847f8eSopenharmony_ci * @since 12 438061847f8eSopenharmony_ci */ 438161847f8eSopenharmony_ci isWatermarkSupported(): Promise<boolean>; 438261847f8eSopenharmony_ci /** 438361847f8eSopenharmony_ci * Set watermark image to recorder. 438461847f8eSopenharmony_ci * @param { image.PixelMap } watermark : Watermark image. 438561847f8eSopenharmony_ci * @param { WatermarkConfig } config : Configures of the watermark. 438661847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when the function is finished. 438761847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. 438861847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 438961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 439061847f8eSopenharmony_ci * @systemapi 439161847f8eSopenharmony_ci * @since 12 439261847f8eSopenharmony_ci */ 439361847f8eSopenharmony_ci setWatermark(watermark: image.PixelMap, config: WatermarkConfig): Promise<void> 439461847f8eSopenharmony_ci /** 439561847f8eSopenharmony_ci * Update the video orientation before recorder start. 439661847f8eSopenharmony_ci * @param { number } rotation - Rotation angle, should be [0, 90, 180, 270]. 439761847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when the function is finished. 439861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 439961847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 440061847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 440161847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 440261847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 440361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 440461847f8eSopenharmony_ci * @since 12 440561847f8eSopenharmony_ci */ 440661847f8eSopenharmony_ci updateRotation(rotation: number): Promise<void>; 440761847f8eSopenharmony_ci 440861847f8eSopenharmony_ci /** 440961847f8eSopenharmony_ci * Start AVRecorder, it will to started state. 441061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when start completed. 441161847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. 441261847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 441361847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 441461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 441561847f8eSopenharmony_ci * @since 9 441661847f8eSopenharmony_ci */ 441761847f8eSopenharmony_ci /** 441861847f8eSopenharmony_ci * Start AVRecorder, it will to started state. 441961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when start completed. 442061847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. 442161847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 442261847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 442361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 442461847f8eSopenharmony_ci * @crossplatform 442561847f8eSopenharmony_ci * @since 12 442661847f8eSopenharmony_ci */ 442761847f8eSopenharmony_ci start(callback: AsyncCallback<void>): void; 442861847f8eSopenharmony_ci 442961847f8eSopenharmony_ci /** 443061847f8eSopenharmony_ci * Start AVRecorder, it will to started state. 443161847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when start completed. 443261847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. 443361847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 443461847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 443561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 443661847f8eSopenharmony_ci * @since 9 443761847f8eSopenharmony_ci */ 443861847f8eSopenharmony_ci /** 443961847f8eSopenharmony_ci * Start AVRecorder, it will to started state. 444061847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when start completed. 444161847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. 444261847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 444361847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 444461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 444561847f8eSopenharmony_ci * @crossplatform 444661847f8eSopenharmony_ci * @atomicservice 444761847f8eSopenharmony_ci * @since 12 444861847f8eSopenharmony_ci */ 444961847f8eSopenharmony_ci start(): Promise<void>; 445061847f8eSopenharmony_ci 445161847f8eSopenharmony_ci /** 445261847f8eSopenharmony_ci * Start AVRecorder, it will to paused state. 445361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when pause completed. 445461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. 445561847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 445661847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 445761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 445861847f8eSopenharmony_ci * @since 9 445961847f8eSopenharmony_ci */ 446061847f8eSopenharmony_ci /** 446161847f8eSopenharmony_ci * Start AVRecorder, it will to paused state. 446261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when pause completed. 446361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. 446461847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 446561847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 446661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 446761847f8eSopenharmony_ci * @crossplatform 446861847f8eSopenharmony_ci * @since 12 446961847f8eSopenharmony_ci */ 447061847f8eSopenharmony_ci pause(callback: AsyncCallback<void>): void; 447161847f8eSopenharmony_ci 447261847f8eSopenharmony_ci /** 447361847f8eSopenharmony_ci * Start AVRecorder, it will to paused state. 447461847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when pause completed. 447561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. 447661847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 447761847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 447861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 447961847f8eSopenharmony_ci * @since 9 448061847f8eSopenharmony_ci */ 448161847f8eSopenharmony_ci /** 448261847f8eSopenharmony_ci * Start AVRecorder, it will to paused state. 448361847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when pause completed. 448461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. 448561847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 448661847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 448761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 448861847f8eSopenharmony_ci * @crossplatform 448961847f8eSopenharmony_ci * @atomicservice 449061847f8eSopenharmony_ci * @since 12 449161847f8eSopenharmony_ci */ 449261847f8eSopenharmony_ci pause(): Promise<void>; 449361847f8eSopenharmony_ci 449461847f8eSopenharmony_ci /** 449561847f8eSopenharmony_ci * Resume AVRecorder, it will to started state. 449661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when resume completed. 449761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. 449861847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 449961847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 450061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 450161847f8eSopenharmony_ci * @since 9 450261847f8eSopenharmony_ci */ 450361847f8eSopenharmony_ci /** 450461847f8eSopenharmony_ci * Resume AVRecorder, it will to started state. 450561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when resume completed. 450661847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. 450761847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 450861847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 450961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 451061847f8eSopenharmony_ci * @crossplatform 451161847f8eSopenharmony_ci * @since 12 451261847f8eSopenharmony_ci */ 451361847f8eSopenharmony_ci resume(callback: AsyncCallback<void>): void; 451461847f8eSopenharmony_ci 451561847f8eSopenharmony_ci /** 451661847f8eSopenharmony_ci * Resume AVRecorder, it will to started state. 451761847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when resume completed. 451861847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. 451961847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 452061847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 452161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 452261847f8eSopenharmony_ci * @since 9 452361847f8eSopenharmony_ci */ 452461847f8eSopenharmony_ci /** 452561847f8eSopenharmony_ci * Resume AVRecorder, it will to started state. 452661847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when resume completed. 452761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. 452861847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 452961847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 453061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 453161847f8eSopenharmony_ci * @crossplatform 453261847f8eSopenharmony_ci * @atomicservice 453361847f8eSopenharmony_ci * @since 12 453461847f8eSopenharmony_ci */ 453561847f8eSopenharmony_ci resume(): Promise<void>; 453661847f8eSopenharmony_ci 453761847f8eSopenharmony_ci /** 453861847f8eSopenharmony_ci * Stop AVRecorder, it will to stopped state. 453961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when stop completed. 454061847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. 454161847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 454261847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 454361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 454461847f8eSopenharmony_ci * @since 9 454561847f8eSopenharmony_ci */ 454661847f8eSopenharmony_ci /** 454761847f8eSopenharmony_ci * Stop AVRecorder, it will to stopped state. 454861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when stop completed. 454961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. 455061847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 455161847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 455261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 455361847f8eSopenharmony_ci * @crossplatform 455461847f8eSopenharmony_ci * @since 12 455561847f8eSopenharmony_ci */ 455661847f8eSopenharmony_ci stop(callback: AsyncCallback<void>): void; 455761847f8eSopenharmony_ci 455861847f8eSopenharmony_ci /** 455961847f8eSopenharmony_ci * Stop AVRecorder, it will to stopped state. 456061847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when stop completed. 456161847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. 456261847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 456361847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 456461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 456561847f8eSopenharmony_ci * @since 9 456661847f8eSopenharmony_ci */ 456761847f8eSopenharmony_ci /** 456861847f8eSopenharmony_ci * Stop AVRecorder, it will to stopped state. 456961847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when stop completed. 457061847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. 457161847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 457261847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 457361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 457461847f8eSopenharmony_ci * @crossplatform 457561847f8eSopenharmony_ci * @atomicservice 457661847f8eSopenharmony_ci * @since 12 457761847f8eSopenharmony_ci */ 457861847f8eSopenharmony_ci stop(): Promise<void>; 457961847f8eSopenharmony_ci 458061847f8eSopenharmony_ci /** 458161847f8eSopenharmony_ci * Reset AVRecorder, it will to idle state. 458261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when reset completed. 458361847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 458461847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 458561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 458661847f8eSopenharmony_ci * @since 9 458761847f8eSopenharmony_ci */ 458861847f8eSopenharmony_ci /** 458961847f8eSopenharmony_ci * Reset AVRecorder, it will to idle state. 459061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when reset completed. 459161847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 459261847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 459361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 459461847f8eSopenharmony_ci * @crossplatform 459561847f8eSopenharmony_ci * @since 12 459661847f8eSopenharmony_ci */ 459761847f8eSopenharmony_ci reset(callback: AsyncCallback<void>): void; 459861847f8eSopenharmony_ci 459961847f8eSopenharmony_ci /** 460061847f8eSopenharmony_ci * Reset AVRecorder, it will to idle state. 460161847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when reset completed. 460261847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 460361847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 460461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 460561847f8eSopenharmony_ci * @since 9 460661847f8eSopenharmony_ci */ 460761847f8eSopenharmony_ci /** 460861847f8eSopenharmony_ci * Reset AVRecorder, it will to idle state. 460961847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when reset completed. 461061847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 461161847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 461261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 461361847f8eSopenharmony_ci * @crossplatform 461461847f8eSopenharmony_ci * @since 12 461561847f8eSopenharmony_ci */ 461661847f8eSopenharmony_ci reset(): Promise<void>; 461761847f8eSopenharmony_ci 461861847f8eSopenharmony_ci /** 461961847f8eSopenharmony_ci * Releases resources used for AVRecorder, it will to released state. 462061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when release completed. 462161847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 462261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 462361847f8eSopenharmony_ci * @since 9 462461847f8eSopenharmony_ci */ 462561847f8eSopenharmony_ci /** 462661847f8eSopenharmony_ci * Releases resources used for AVRecorder, it will to released state. 462761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when release completed. 462861847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 462961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 463061847f8eSopenharmony_ci * @crossplatform 463161847f8eSopenharmony_ci * @since 12 463261847f8eSopenharmony_ci */ 463361847f8eSopenharmony_ci release(callback: AsyncCallback<void>): void; 463461847f8eSopenharmony_ci 463561847f8eSopenharmony_ci /** 463661847f8eSopenharmony_ci * Releases resources used for AVRecorder, it will to released state. 463761847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when release completed. 463861847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 463961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 464061847f8eSopenharmony_ci * @since 9 464161847f8eSopenharmony_ci */ 464261847f8eSopenharmony_ci /** 464361847f8eSopenharmony_ci * Releases resources used for AVRecorder, it will to released state. 464461847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when release completed. 464561847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 464661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 464761847f8eSopenharmony_ci * @crossplatform 464861847f8eSopenharmony_ci * @atomicservice 464961847f8eSopenharmony_ci * @since 12 465061847f8eSopenharmony_ci */ 465161847f8eSopenharmony_ci release(): Promise<void>; 465261847f8eSopenharmony_ci 465361847f8eSopenharmony_ci /** 465461847f8eSopenharmony_ci * Get AudioCapturer info from current AVRecorder. 465561847f8eSopenharmony_ci * @param { AsyncCallback<audio.AudioCapturerChangeInfo> } callback - A callback used to return AudioCapturerChangeInfo. 465661847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 465761847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. 465861847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 465961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 466061847f8eSopenharmony_ci * @since 11 466161847f8eSopenharmony_ci */ 466261847f8eSopenharmony_ci getCurrentAudioCapturerInfo(callback: AsyncCallback<audio.AudioCapturerChangeInfo>): void; 466361847f8eSopenharmony_ci 466461847f8eSopenharmony_ci /** 466561847f8eSopenharmony_ci * Get AudioCapturer info from current AVRecorder. 466661847f8eSopenharmony_ci * @returns { Promise<audio.AudioCapturerChangeInfo> } A Promise instance used to return AudioCapturerChangeInfo. 466761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 466861847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. 466961847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 467061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 467161847f8eSopenharmony_ci * @since 11 467261847f8eSopenharmony_ci */ 467361847f8eSopenharmony_ci getCurrentAudioCapturerInfo(): Promise<audio.AudioCapturerChangeInfo>; 467461847f8eSopenharmony_ci 467561847f8eSopenharmony_ci /** 467661847f8eSopenharmony_ci * Get max audio capturer amplitude from current AVRecorder. 467761847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - A callback used to return max Amplitude. 467861847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 467961847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 468061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 468161847f8eSopenharmony_ci * @since 11 468261847f8eSopenharmony_ci */ 468361847f8eSopenharmony_ci getAudioCapturerMaxAmplitude(callback: AsyncCallback<number>): void; 468461847f8eSopenharmony_ci 468561847f8eSopenharmony_ci /** 468661847f8eSopenharmony_ci * Get max audio capturer amplitude from current AVRecorder. 468761847f8eSopenharmony_ci * @returns { Promise<number> } A Promise instance used to return max Amplitude. 468861847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 468961847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 469061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 469161847f8eSopenharmony_ci * @since 11 469261847f8eSopenharmony_ci */ 469361847f8eSopenharmony_ci getAudioCapturerMaxAmplitude(): Promise<number>; 469461847f8eSopenharmony_ci 469561847f8eSopenharmony_ci /** 469661847f8eSopenharmony_ci * Get available encoder and encoder info for AVRecorder. 469761847f8eSopenharmony_ci * @param { AsyncCallback<Array<EncoderInfo>> } callback - A callback used to return available encoder info. 469861847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 469961847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 470061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 470161847f8eSopenharmony_ci * @since 11 470261847f8eSopenharmony_ci */ 470361847f8eSopenharmony_ci getAvailableEncoder(callback: AsyncCallback<Array<EncoderInfo>>): void; 470461847f8eSopenharmony_ci 470561847f8eSopenharmony_ci /** 470661847f8eSopenharmony_ci * Get available encoder and encoder info for AVRecorder. 470761847f8eSopenharmony_ci * @returns { Promise<Array<EncoderInfo>> } A Promise instance used to return available encoder info. 470861847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 470961847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 471061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 471161847f8eSopenharmony_ci * @since 11 471261847f8eSopenharmony_ci */ 471361847f8eSopenharmony_ci getAvailableEncoder(): Promise<Array<EncoderInfo>>; 471461847f8eSopenharmony_ci 471561847f8eSopenharmony_ci /** 471661847f8eSopenharmony_ci * Recorder state. 471761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 471861847f8eSopenharmony_ci * @since 9 471961847f8eSopenharmony_ci */ 472061847f8eSopenharmony_ci /** 472161847f8eSopenharmony_ci * Recorder state. 472261847f8eSopenharmony_ci * @type { AVRecorderState } 472361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 472461847f8eSopenharmony_ci * @crossplatform 472561847f8eSopenharmony_ci * @atomicservice 472661847f8eSopenharmony_ci * @since 12 472761847f8eSopenharmony_ci */ 472861847f8eSopenharmony_ci readonly state: AVRecorderState; 472961847f8eSopenharmony_ci 473061847f8eSopenharmony_ci /** 473161847f8eSopenharmony_ci * Listens for recording audioCapturerChange events. 473261847f8eSopenharmony_ci * @param { 'audioCapturerChange' } type - Type of the audioCapturerChange event to listen for. 473361847f8eSopenharmony_ci * @param { Callback<audio.AudioCapturerChangeInfo> } callback - Callback used to listen device change event. 473461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 473561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 473661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 473761847f8eSopenharmony_ci * @since 11 473861847f8eSopenharmony_ci */ 473961847f8eSopenharmony_ci on(type: 'audioCapturerChange', callback: Callback<audio.AudioCapturerChangeInfo>): void; 474061847f8eSopenharmony_ci 474161847f8eSopenharmony_ci /** 474261847f8eSopenharmony_ci * Listens for photo asset events. 474361847f8eSopenharmony_ci * @param { 'photoAssetAvailable' } type - Type of the recording event to listen for. 474461847f8eSopenharmony_ci * @param { Callback<photoAccessHelper.PhotoAsset> } callback - Callback used to listen for the photo asset event. 474561847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 474661847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 474761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 474861847f8eSopenharmony_ci * @since 12 474961847f8eSopenharmony_ci */ 475061847f8eSopenharmony_ci on(type: 'photoAssetAvailable', callback: Callback<photoAccessHelper.PhotoAsset>): void; 475161847f8eSopenharmony_ci /** 475261847f8eSopenharmony_ci * Listens for recording stateChange events. 475361847f8eSopenharmony_ci * @param { 'stateChange' } type - Type of the recording event to listen for. 475461847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the recorder stateChange event. 475561847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 475661847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 475761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 475861847f8eSopenharmony_ci * @since 9 475961847f8eSopenharmony_ci */ 476061847f8eSopenharmony_ci /** 476161847f8eSopenharmony_ci * Listens for recording stateChange events. 476261847f8eSopenharmony_ci * @param { 'stateChange' } type - Type of the recording event to listen for. 476361847f8eSopenharmony_ci * @param { OnAVRecorderStateChangeHandler } callback - Callback used to listen for the recorder stateChange event. 476461847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by callback. 476561847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 476661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 476761847f8eSopenharmony_ci * @crossplatform 476861847f8eSopenharmony_ci * @atomicservice 476961847f8eSopenharmony_ci * @since 12 477061847f8eSopenharmony_ci */ 477161847f8eSopenharmony_ci on(type: 'stateChange', callback: OnAVRecorderStateChangeHandler): void; 477261847f8eSopenharmony_ci 477361847f8eSopenharmony_ci /** 477461847f8eSopenharmony_ci * Listens for recording error events. 477561847f8eSopenharmony_ci * @param { 'error' } type - Type of the recording error event to listen for. 477661847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the recorder error event. 477761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 477861847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. 477961847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 478061847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. 478161847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 478261847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. 478361847f8eSopenharmony_ci * @throws { BusinessError } 5400104 - Time out. 478461847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. 478561847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. 478661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 478761847f8eSopenharmony_ci * @since 9 478861847f8eSopenharmony_ci */ 478961847f8eSopenharmony_ci /** 479061847f8eSopenharmony_ci * Listens for recording error events. 479161847f8eSopenharmony_ci * @param { 'error' } type - Type of the recording error event to listen for. 479261847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the recorder error event. 479361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 479461847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. 479561847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 479661847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. 479761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 479861847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. 479961847f8eSopenharmony_ci * @throws { BusinessError } 5400104 - Time out. 480061847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. 480161847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. 480261847f8eSopenharmony_ci * @throws { BusinessError } 5400107 - Audio interrupted. 480361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 480461847f8eSopenharmony_ci * @since 11 480561847f8eSopenharmony_ci */ 480661847f8eSopenharmony_ci /** 480761847f8eSopenharmony_ci * Listens for recording error events. 480861847f8eSopenharmony_ci * @param { 'error' } type - Type of the recording error event to listen for. 480961847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the recorder error event. 481061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 481161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 481261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 481361847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 481461847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. 481561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 481661847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. 481761847f8eSopenharmony_ci * @throws { BusinessError } 5400104 - Time out. 481861847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. 481961847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. 482061847f8eSopenharmony_ci * @throws { BusinessError } 5400107 - Audio interrupted. 482161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 482261847f8eSopenharmony_ci * @crossplatform 482361847f8eSopenharmony_ci * @atomicservice 482461847f8eSopenharmony_ci * @since 12 482561847f8eSopenharmony_ci */ 482661847f8eSopenharmony_ci on(type: 'error', callback: ErrorCallback): void; 482761847f8eSopenharmony_ci 482861847f8eSopenharmony_ci /** 482961847f8eSopenharmony_ci * Cancel Listens for recording stateChange events. 483061847f8eSopenharmony_ci * @param { 'stateChange' } type - Type of the recording stateChange event to listen for. 483161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 483261847f8eSopenharmony_ci * @since 9 483361847f8eSopenharmony_ci */ 483461847f8eSopenharmony_ci /** 483561847f8eSopenharmony_ci * Cancel Listens for recording stateChange events. 483661847f8eSopenharmony_ci * @param { 'stateChange' } type - Type of the recording stateChange event to listen for. 483761847f8eSopenharmony_ci * @param { OnAVRecorderStateChangeHandler } callback - Callback used to listen for the recorder stateChange event. 483861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 483961847f8eSopenharmony_ci * @crossplatform 484061847f8eSopenharmony_ci * @atomicservice 484161847f8eSopenharmony_ci * @since 12 484261847f8eSopenharmony_ci */ 484361847f8eSopenharmony_ci off(type: 'stateChange', callback?: OnAVRecorderStateChangeHandler): void; 484461847f8eSopenharmony_ci 484561847f8eSopenharmony_ci /** 484661847f8eSopenharmony_ci * Cancel Listens for recording error events. 484761847f8eSopenharmony_ci * @param { 'error' } type - Type of the recording error event to listen for. 484861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 484961847f8eSopenharmony_ci * @since 9 485061847f8eSopenharmony_ci */ 485161847f8eSopenharmony_ci /** 485261847f8eSopenharmony_ci * Cancel Listens for recording error events. 485361847f8eSopenharmony_ci * @param { 'error' } type - Type of the recording error event to listen for. 485461847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the recorder error event. 485561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 485661847f8eSopenharmony_ci * @crossplatform 485761847f8eSopenharmony_ci * @atomicservice 485861847f8eSopenharmony_ci * @since 12 485961847f8eSopenharmony_ci */ 486061847f8eSopenharmony_ci off(type: 'error', callback?: ErrorCallback): void; 486161847f8eSopenharmony_ci 486261847f8eSopenharmony_ci /** 486361847f8eSopenharmony_ci * Cancel Listens for recording audioCapturerChange events. 486461847f8eSopenharmony_ci * @param { 'audioCapturerChange' } type - Type of the audioCapturerChange event to listen for. 486561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 486661847f8eSopenharmony_ci * @since 11 486761847f8eSopenharmony_ci */ 486861847f8eSopenharmony_ci /** 486961847f8eSopenharmony_ci * Cancel Listens for recording audioCapturerChange events. 487061847f8eSopenharmony_ci * @param { 'audioCapturerChange' } type - Type of the audioCapturerChange event to listen for. 487161847f8eSopenharmony_ci * @param { Callback<audio.AudioCapturerChangeInfo> } callback - Callback used to listen device change event. 487261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 487361847f8eSopenharmony_ci * @since 12 487461847f8eSopenharmony_ci */ 487561847f8eSopenharmony_ci off(type: 'audioCapturerChange', callback?: Callback<audio.AudioCapturerChangeInfo>): void; 487661847f8eSopenharmony_ci 487761847f8eSopenharmony_ci /** 487861847f8eSopenharmony_ci * Cancel Listens for photo asset events. 487961847f8eSopenharmony_ci * @param { 'photoAssetAvailable' } type - Type of the recording event to listen for. 488061847f8eSopenharmony_ci * @param { Callback<photoAccessHelper.PhotoAsset> } callback - Callback used to listen for the photo asset event. 488161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 488261847f8eSopenharmony_ci * @since 12 488361847f8eSopenharmony_ci */ 488461847f8eSopenharmony_ci off(type: 'photoAssetAvailable', callback?: Callback<photoAccessHelper.PhotoAsset>): void; 488561847f8eSopenharmony_ci } 488661847f8eSopenharmony_ci 488761847f8eSopenharmony_ci /** 488861847f8eSopenharmony_ci * Enumerates audio encoding formats, it will be deprecated after API8, use @CodecMimeType to replace. 488961847f8eSopenharmony_ci * 489061847f8eSopenharmony_ci * @enum { number } 489161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 489261847f8eSopenharmony_ci * @since 6 489361847f8eSopenharmony_ci * @deprecated since 8 489461847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.CodecMimeType 489561847f8eSopenharmony_ci */ 489661847f8eSopenharmony_ci enum AudioEncoder { 489761847f8eSopenharmony_ci /** 489861847f8eSopenharmony_ci * Default audio encoding format, which is AMR-NB. 489961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 490061847f8eSopenharmony_ci * @since 6 490161847f8eSopenharmony_ci * @deprecated since 8 490261847f8eSopenharmony_ci */ 490361847f8eSopenharmony_ci DEFAULT = 0, 490461847f8eSopenharmony_ci 490561847f8eSopenharmony_ci /** 490661847f8eSopenharmony_ci * Indicates the AMR-NB audio encoding format. 490761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 490861847f8eSopenharmony_ci * @since 6 490961847f8eSopenharmony_ci * @deprecated since 8 491061847f8eSopenharmony_ci */ 491161847f8eSopenharmony_ci AMR_NB = 1, 491261847f8eSopenharmony_ci 491361847f8eSopenharmony_ci /** 491461847f8eSopenharmony_ci * Indicates the AMR-WB audio encoding format. 491561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 491661847f8eSopenharmony_ci * @since 6 491761847f8eSopenharmony_ci * @deprecated since 8 491861847f8eSopenharmony_ci */ 491961847f8eSopenharmony_ci AMR_WB = 2, 492061847f8eSopenharmony_ci 492161847f8eSopenharmony_ci /** 492261847f8eSopenharmony_ci * Advanced Audio Coding Low Complexity (AAC-LC). 492361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 492461847f8eSopenharmony_ci * @since 6 492561847f8eSopenharmony_ci * @deprecated since 8 492661847f8eSopenharmony_ci */ 492761847f8eSopenharmony_ci AAC_LC = 3, 492861847f8eSopenharmony_ci 492961847f8eSopenharmony_ci /** 493061847f8eSopenharmony_ci * High-Efficiency Advanced Audio Coding (HE-AAC). 493161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 493261847f8eSopenharmony_ci * @since 6 493361847f8eSopenharmony_ci * @deprecated since 8 493461847f8eSopenharmony_ci */ 493561847f8eSopenharmony_ci HE_AAC = 4 493661847f8eSopenharmony_ci } 493761847f8eSopenharmony_ci 493861847f8eSopenharmony_ci /** 493961847f8eSopenharmony_ci * Enumerates audio output formats, it will be deprecated after API8, use @ContainerFormatType to replace. 494061847f8eSopenharmony_ci * 494161847f8eSopenharmony_ci * @enum { number } 494261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 494361847f8eSopenharmony_ci * @since 6 494461847f8eSopenharmony_ci * @deprecated since 8 494561847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.ContainerFormatType 494661847f8eSopenharmony_ci */ 494761847f8eSopenharmony_ci enum AudioOutputFormat { 494861847f8eSopenharmony_ci /** 494961847f8eSopenharmony_ci * Default audio output format, which is Moving Pictures Expert Group 4 (MPEG-4). 495061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 495161847f8eSopenharmony_ci * @since 6 495261847f8eSopenharmony_ci * @deprecated since 8 495361847f8eSopenharmony_ci */ 495461847f8eSopenharmony_ci DEFAULT = 0, 495561847f8eSopenharmony_ci 495661847f8eSopenharmony_ci /** 495761847f8eSopenharmony_ci * Indicates the Moving Picture Experts Group-4 (MPEG4) media format. 495861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 495961847f8eSopenharmony_ci * @since 6 496061847f8eSopenharmony_ci * @deprecated since 8 496161847f8eSopenharmony_ci */ 496261847f8eSopenharmony_ci MPEG_4 = 2, 496361847f8eSopenharmony_ci 496461847f8eSopenharmony_ci /** 496561847f8eSopenharmony_ci * Indicates the Adaptive Multi-Rate Narrowband (AMR-NB) media format. 496661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 496761847f8eSopenharmony_ci * @since 6 496861847f8eSopenharmony_ci * @deprecated since 8 496961847f8eSopenharmony_ci */ 497061847f8eSopenharmony_ci AMR_NB = 3, 497161847f8eSopenharmony_ci 497261847f8eSopenharmony_ci /** 497361847f8eSopenharmony_ci * Indicates the Adaptive Multi-Rate Wideband (AMR-WB) media format. 497461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 497561847f8eSopenharmony_ci * @since 6 497661847f8eSopenharmony_ci * @deprecated since 8 497761847f8eSopenharmony_ci */ 497861847f8eSopenharmony_ci AMR_WB = 4, 497961847f8eSopenharmony_ci 498061847f8eSopenharmony_ci /** 498161847f8eSopenharmony_ci * Audio Data Transport Stream (ADTS), a transmission stream format of Advanced Audio Coding (AAC) audio. 498261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 498361847f8eSopenharmony_ci * @since 6 498461847f8eSopenharmony_ci * @deprecated since 8 498561847f8eSopenharmony_ci */ 498661847f8eSopenharmony_ci AAC_ADTS = 6 498761847f8eSopenharmony_ci } 498861847f8eSopenharmony_ci 498961847f8eSopenharmony_ci /** 499061847f8eSopenharmony_ci * Provides the geographical location definitions for media resources. 499161847f8eSopenharmony_ci * 499261847f8eSopenharmony_ci * @typedef Location 499361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 499461847f8eSopenharmony_ci * @since 6 499561847f8eSopenharmony_ci */ 499661847f8eSopenharmony_ci /** 499761847f8eSopenharmony_ci * Provides the geographical location definitions for media resources. 499861847f8eSopenharmony_ci * 499961847f8eSopenharmony_ci * @typedef Location 500061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 500161847f8eSopenharmony_ci * @crossplatform 500261847f8eSopenharmony_ci * @since 12 500361847f8eSopenharmony_ci */ 500461847f8eSopenharmony_ci interface Location { 500561847f8eSopenharmony_ci /** 500661847f8eSopenharmony_ci * Latitude. 500761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 500861847f8eSopenharmony_ci * @since 6 500961847f8eSopenharmony_ci */ 501061847f8eSopenharmony_ci /** 501161847f8eSopenharmony_ci * Latitude. 501261847f8eSopenharmony_ci * @type { number } 501361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 501461847f8eSopenharmony_ci * @crossplatform 501561847f8eSopenharmony_ci * @since 12 501661847f8eSopenharmony_ci */ 501761847f8eSopenharmony_ci latitude: number; 501861847f8eSopenharmony_ci 501961847f8eSopenharmony_ci /** 502061847f8eSopenharmony_ci * Longitude. 502161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 502261847f8eSopenharmony_ci * @since 6 502361847f8eSopenharmony_ci */ 502461847f8eSopenharmony_ci /** 502561847f8eSopenharmony_ci * Longitude. 502661847f8eSopenharmony_ci * @type { number } 502761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 502861847f8eSopenharmony_ci * @crossplatform 502961847f8eSopenharmony_ci * @since 12 503061847f8eSopenharmony_ci */ 503161847f8eSopenharmony_ci longitude: number; 503261847f8eSopenharmony_ci } 503361847f8eSopenharmony_ci /** 503461847f8eSopenharmony_ci * Set configures of a watermark to AVRecorder. The position starts at top left corner. 503561847f8eSopenharmony_ci * 503661847f8eSopenharmony_ci * @typedef WatermarkConfig 503761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 503861847f8eSopenharmony_ci * @systemapi 503961847f8eSopenharmony_ci * @since 12 504061847f8eSopenharmony_ci */ 504161847f8eSopenharmony_ci interface WatermarkConfig { 504261847f8eSopenharmony_ci /** 504361847f8eSopenharmony_ci * Offset of the watermark to the top line of pixel. 504461847f8eSopenharmony_ci * @type { number } 504561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 504661847f8eSopenharmony_ci * @systemapi 504761847f8eSopenharmony_ci * @since 12 504861847f8eSopenharmony_ci */ 504961847f8eSopenharmony_ci top: number; 505061847f8eSopenharmony_ci /** 505161847f8eSopenharmony_ci * Offset of the watermark to the left line of pixel. 505261847f8eSopenharmony_ci * @type { number } 505361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 505461847f8eSopenharmony_ci * @systemapi 505561847f8eSopenharmony_ci * @since 12 505661847f8eSopenharmony_ci */ 505761847f8eSopenharmony_ci left: number; 505861847f8eSopenharmony_ci } 505961847f8eSopenharmony_ci 506061847f8eSopenharmony_ci /** 506161847f8eSopenharmony_ci * Provides the audio recorder configuration definitions. 506261847f8eSopenharmony_ci * 506361847f8eSopenharmony_ci * @typedef AudioRecorderConfig 506461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 506561847f8eSopenharmony_ci * @since 6 506661847f8eSopenharmony_ci * @deprecated since 9 506761847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVRecorderConfig 506861847f8eSopenharmony_ci */ 506961847f8eSopenharmony_ci interface AudioRecorderConfig { 507061847f8eSopenharmony_ci /** 507161847f8eSopenharmony_ci * Audio encoding format. The default value is DEFAULT, it will be deprecated after API8. 507261847f8eSopenharmony_ci * use "audioEncoderMime" instead. 507361847f8eSopenharmony_ci * @type { ?AudioEncoder } 507461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 507561847f8eSopenharmony_ci * @since 6 507661847f8eSopenharmony_ci * @deprecated since 8 507761847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AudioRecorderConfig.audioEncoderMime 507861847f8eSopenharmony_ci */ 507961847f8eSopenharmony_ci audioEncoder?: AudioEncoder; 508061847f8eSopenharmony_ci 508161847f8eSopenharmony_ci /** 508261847f8eSopenharmony_ci * Audio encoding bit rate. 508361847f8eSopenharmony_ci * @type { ?number } 508461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 508561847f8eSopenharmony_ci * @since 6 508661847f8eSopenharmony_ci * @deprecated since 9 508761847f8eSopenharmony_ci */ 508861847f8eSopenharmony_ci audioEncodeBitRate?: number; 508961847f8eSopenharmony_ci 509061847f8eSopenharmony_ci /** 509161847f8eSopenharmony_ci * Audio sampling rate. 509261847f8eSopenharmony_ci * @type { ?number } 509361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 509461847f8eSopenharmony_ci * @since 6 509561847f8eSopenharmony_ci * @deprecated since 9 509661847f8eSopenharmony_ci */ 509761847f8eSopenharmony_ci audioSampleRate?: number; 509861847f8eSopenharmony_ci 509961847f8eSopenharmony_ci /** 510061847f8eSopenharmony_ci * Number of audio channels. 510161847f8eSopenharmony_ci * @type { ?number } 510261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 510361847f8eSopenharmony_ci * @since 6 510461847f8eSopenharmony_ci * @deprecated since 9 510561847f8eSopenharmony_ci */ 510661847f8eSopenharmony_ci numberOfChannels?: number; 510761847f8eSopenharmony_ci 510861847f8eSopenharmony_ci /** 510961847f8eSopenharmony_ci * Audio output format. The default value is DEFAULT, it will be deprecated after API8. 511061847f8eSopenharmony_ci * it will be replaced with "fileFormat". 511161847f8eSopenharmony_ci * @type { ?AudioOutputFormat } 511261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 511361847f8eSopenharmony_ci * @since 6 511461847f8eSopenharmony_ci * @deprecated since 8 511561847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AudioRecorderConfig.fileFormat 511661847f8eSopenharmony_ci */ 511761847f8eSopenharmony_ci format?: AudioOutputFormat; 511861847f8eSopenharmony_ci 511961847f8eSopenharmony_ci /** 512061847f8eSopenharmony_ci * Audio output uri.support two kind of uri now. 512161847f8eSopenharmony_ci * format like: scheme + "://" + "context". 512261847f8eSopenharmony_ci * file: file://path 512361847f8eSopenharmony_ci * fd: fd://fd 512461847f8eSopenharmony_ci * @type { string } 512561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 512661847f8eSopenharmony_ci * @since 6 512761847f8eSopenharmony_ci * @deprecated since 9 512861847f8eSopenharmony_ci */ 512961847f8eSopenharmony_ci uri: string; 513061847f8eSopenharmony_ci 513161847f8eSopenharmony_ci /** 513261847f8eSopenharmony_ci * Geographical location information. 513361847f8eSopenharmony_ci * @type { ?Location } 513461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 513561847f8eSopenharmony_ci * @since 6 513661847f8eSopenharmony_ci * @deprecated since 9 513761847f8eSopenharmony_ci */ 513861847f8eSopenharmony_ci location?: Location; 513961847f8eSopenharmony_ci 514061847f8eSopenharmony_ci /** 514161847f8eSopenharmony_ci * audio encoding format MIME. it used to replace audioEncoder. 514261847f8eSopenharmony_ci * @type { ?CodecMimeType } 514361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 514461847f8eSopenharmony_ci * @since 8 514561847f8eSopenharmony_ci * @deprecated since 9 514661847f8eSopenharmony_ci */ 514761847f8eSopenharmony_ci audioEncoderMime?: CodecMimeType; 514861847f8eSopenharmony_ci /** 514961847f8eSopenharmony_ci * output file format. see @ContainerFormatType , it used to replace "format". 515061847f8eSopenharmony_ci * @type { ?ContainerFormatType } 515161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 515261847f8eSopenharmony_ci * @since 8 515361847f8eSopenharmony_ci * @deprecated since 9 515461847f8eSopenharmony_ci */ 515561847f8eSopenharmony_ci fileFormat?: ContainerFormatType; 515661847f8eSopenharmony_ci } 515761847f8eSopenharmony_ci 515861847f8eSopenharmony_ci /** 515961847f8eSopenharmony_ci * Manages and record audio. Before calling an AudioRecorder method, you must use createAudioRecorder() 516061847f8eSopenharmony_ci * to create an AudioRecorder instance. 516161847f8eSopenharmony_ci * 516261847f8eSopenharmony_ci * @typedef AudioRecorder 516361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 516461847f8eSopenharmony_ci * @since 6 516561847f8eSopenharmony_ci * @deprecated since 9 516661847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVRecorder 516761847f8eSopenharmony_ci */ 516861847f8eSopenharmony_ci interface AudioRecorder { 516961847f8eSopenharmony_ci /** 517061847f8eSopenharmony_ci * Prepares for recording. 517161847f8eSopenharmony_ci * @permission ohos.permission.MICROPHONE 517261847f8eSopenharmony_ci * @param { AudioRecorderConfig } config - Recording parameters. 517361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 517461847f8eSopenharmony_ci * @since 6 517561847f8eSopenharmony_ci * @deprecated since 9 517661847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVRecorder#prepare 517761847f8eSopenharmony_ci */ 517861847f8eSopenharmony_ci /** 517961847f8eSopenharmony_ci * Prepares for recording. 518061847f8eSopenharmony_ci * @permission ohos.permission.MICROPHONE 518161847f8eSopenharmony_ci * @param { AudioRecorderConfig } config - Recording parameters. 518261847f8eSopenharmony_ci * @throws { BusinessError } 201 - permission denied. 518361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 518461847f8eSopenharmony_ci * @since 12 518561847f8eSopenharmony_ci * @deprecated since 9 518661847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVRecorder#prepare 518761847f8eSopenharmony_ci */ 518861847f8eSopenharmony_ci prepare(config: AudioRecorderConfig): void; 518961847f8eSopenharmony_ci 519061847f8eSopenharmony_ci /** 519161847f8eSopenharmony_ci * Starts audio recording. 519261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 519361847f8eSopenharmony_ci * @since 6 519461847f8eSopenharmony_ci * @deprecated since 9 519561847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVRecorder#start 519661847f8eSopenharmony_ci */ 519761847f8eSopenharmony_ci start(): void; 519861847f8eSopenharmony_ci 519961847f8eSopenharmony_ci /** 520061847f8eSopenharmony_ci * Pauses audio recording. 520161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 520261847f8eSopenharmony_ci * @since 6 520361847f8eSopenharmony_ci * @deprecated since 9 520461847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVRecorder#pause 520561847f8eSopenharmony_ci */ 520661847f8eSopenharmony_ci pause(): void; 520761847f8eSopenharmony_ci 520861847f8eSopenharmony_ci /** 520961847f8eSopenharmony_ci * Resumes audio recording. 521061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 521161847f8eSopenharmony_ci * @since 6 521261847f8eSopenharmony_ci * @deprecated since 9 521361847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVRecorder#resume 521461847f8eSopenharmony_ci */ 521561847f8eSopenharmony_ci resume(): void; 521661847f8eSopenharmony_ci 521761847f8eSopenharmony_ci /** 521861847f8eSopenharmony_ci * Stops audio recording. 521961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 522061847f8eSopenharmony_ci * @since 6 522161847f8eSopenharmony_ci * @deprecated since 9 522261847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVRecorder#stop 522361847f8eSopenharmony_ci */ 522461847f8eSopenharmony_ci stop(): void; 522561847f8eSopenharmony_ci 522661847f8eSopenharmony_ci /** 522761847f8eSopenharmony_ci * Releases resources used for audio recording. 522861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 522961847f8eSopenharmony_ci * @since 6 523061847f8eSopenharmony_ci * @deprecated since 9 523161847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVRecorder#release 523261847f8eSopenharmony_ci */ 523361847f8eSopenharmony_ci release(): void; 523461847f8eSopenharmony_ci 523561847f8eSopenharmony_ci /** 523661847f8eSopenharmony_ci * Resets audio recording. 523761847f8eSopenharmony_ci * Before resetting audio recording, you must call stop() to stop recording. After audio recording is reset, 523861847f8eSopenharmony_ci * you must call prepare() to set the recording configurations for another recording. 523961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 524061847f8eSopenharmony_ci * @since 6 524161847f8eSopenharmony_ci * @deprecated since 9 524261847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVRecorder#reset 524361847f8eSopenharmony_ci */ 524461847f8eSopenharmony_ci reset(): void; 524561847f8eSopenharmony_ci 524661847f8eSopenharmony_ci /** 524761847f8eSopenharmony_ci * Listens for audio recording events. 524861847f8eSopenharmony_ci * @param { 'prepare' | 'start' | 'pause' | 'resume' | 'stop' | 'release' | 'reset' } type - Type of the audio recording event to listen for. 524961847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the audio recording event. 525061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 525161847f8eSopenharmony_ci * @since 6 525261847f8eSopenharmony_ci * @deprecated since 9 525361847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVRecorder#on 525461847f8eSopenharmony_ci */ 525561847f8eSopenharmony_ci on(type: 'prepare' | 'start' | 'pause' | 'resume' | 'stop' | 'release' | 'reset', callback: () => void): void; 525661847f8eSopenharmony_ci 525761847f8eSopenharmony_ci /** 525861847f8eSopenharmony_ci * Listens for audio recording error events. 525961847f8eSopenharmony_ci * @param { 'error' } type - Type of the audio recording error event to listen for. 526061847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the audio recording error event. 526161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AudioRecorder 526261847f8eSopenharmony_ci * @since 6 526361847f8eSopenharmony_ci * @deprecated since 9 526461847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVRecorder#on 526561847f8eSopenharmony_ci */ 526661847f8eSopenharmony_ci on(type: 'error', callback: ErrorCallback): void; 526761847f8eSopenharmony_ci } 526861847f8eSopenharmony_ci 526961847f8eSopenharmony_ci /** 527061847f8eSopenharmony_ci * The maintenance of this interface has been stopped since version api 9. Please use AVRecorderState. 527161847f8eSopenharmony_ci * Describes video recorder states. 527261847f8eSopenharmony_ci * 527361847f8eSopenharmony_ci * @typedef { 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error' } 527461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 527561847f8eSopenharmony_ci * @systemapi 527661847f8eSopenharmony_ci * @since 9 527761847f8eSopenharmony_ci */ 527861847f8eSopenharmony_ci type VideoRecordState = 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error'; 527961847f8eSopenharmony_ci 528061847f8eSopenharmony_ci /** 528161847f8eSopenharmony_ci * The maintenance of this interface has been stopped since version api 9. Please use AVRecorder. 528261847f8eSopenharmony_ci * Manages and record video. Before calling an VideoRecorder method, you must use createVideoRecorder() 528361847f8eSopenharmony_ci * to create an VideoRecorder instance. 528461847f8eSopenharmony_ci * 528561847f8eSopenharmony_ci * @typedef VideoRecorder 528661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 528761847f8eSopenharmony_ci * @systemapi 528861847f8eSopenharmony_ci * @since 9 528961847f8eSopenharmony_ci */ 529061847f8eSopenharmony_ci interface VideoRecorder { 529161847f8eSopenharmony_ci /** 529261847f8eSopenharmony_ci * Prepares for recording. 529361847f8eSopenharmony_ci * @permission ohos.permission.MICROPHONE 529461847f8eSopenharmony_ci * @param { VideoRecorderConfig } config - Recording parameters. 529561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when prepare completed. 529661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. Return by callback. 529761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 529861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 529961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 530061847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 530161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 530261847f8eSopenharmony_ci * @systemapi 530361847f8eSopenharmony_ci * @since 9 530461847f8eSopenharmony_ci */ 530561847f8eSopenharmony_ci /** 530661847f8eSopenharmony_ci * Prepares for recording. 530761847f8eSopenharmony_ci * @permission ohos.permission.MICROPHONE 530861847f8eSopenharmony_ci * @param { VideoRecorderConfig } config - Recording parameters. 530961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when prepare completed. 531061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. Return by callback. 531161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 531261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 531361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 531461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 531561847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 531661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 531761847f8eSopenharmony_ci * @systemapi 531861847f8eSopenharmony_ci * @since 12 531961847f8eSopenharmony_ci */ 532061847f8eSopenharmony_ci prepare(config: VideoRecorderConfig, callback: AsyncCallback<void>): void; 532161847f8eSopenharmony_ci /** 532261847f8eSopenharmony_ci * Prepares for recording. 532361847f8eSopenharmony_ci * @permission ohos.permission.MICROPHONE 532461847f8eSopenharmony_ci * @param { VideoRecorderConfig } config - Recording parameters. 532561847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when prepare completed. 532661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. Return by promise. 532761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 532861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 532961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 533061847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 533161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 533261847f8eSopenharmony_ci * @systemapi 533361847f8eSopenharmony_ci * @since 9 533461847f8eSopenharmony_ci */ 533561847f8eSopenharmony_ci /** 533661847f8eSopenharmony_ci * Prepares for recording. 533761847f8eSopenharmony_ci * @permission ohos.permission.MICROPHONE 533861847f8eSopenharmony_ci * @param { VideoRecorderConfig } config - Recording parameters. 533961847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when prepare completed. 534061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. Return by promise. 534161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 534261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 534361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3.Parameter verification failed. 534461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 534561847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 534661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 534761847f8eSopenharmony_ci * @systemapi 534861847f8eSopenharmony_ci * @since 12 534961847f8eSopenharmony_ci */ 535061847f8eSopenharmony_ci prepare(config: VideoRecorderConfig): Promise<void>; 535161847f8eSopenharmony_ci /** 535261847f8eSopenharmony_ci * get input surface.it must be called between prepare completed and start. 535361847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Callback used to return the input surface id in string. 535461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 535561847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by callback. 535661847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 535761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 535861847f8eSopenharmony_ci * @systemapi 535961847f8eSopenharmony_ci * @since 9 536061847f8eSopenharmony_ci */ 536161847f8eSopenharmony_ci /** 536261847f8eSopenharmony_ci * get input surface.it must be called between prepare completed and start. 536361847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Callback used to return the input surface id in string. 536461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 536561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 536661847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by callback. 536761847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 536861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 536961847f8eSopenharmony_ci * @systemapi 537061847f8eSopenharmony_ci * @since 12 537161847f8eSopenharmony_ci */ 537261847f8eSopenharmony_ci getInputSurface(callback: AsyncCallback<string>): void; 537361847f8eSopenharmony_ci /** 537461847f8eSopenharmony_ci * get input surface. it must be called between prepare completed and start. 537561847f8eSopenharmony_ci * @returns { Promise<string> } A Promise instance used to return the input surface id in string. 537661847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 537761847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by promise. 537861847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 537961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 538061847f8eSopenharmony_ci * @systemapi 538161847f8eSopenharmony_ci * @since 9 538261847f8eSopenharmony_ci */ 538361847f8eSopenharmony_ci /** 538461847f8eSopenharmony_ci * get input surface. it must be called between prepare completed and start. 538561847f8eSopenharmony_ci * @returns { Promise<string> } A Promise instance used to return the input surface id in string. 538661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 538761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 538861847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by promise. 538961847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 539061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 539161847f8eSopenharmony_ci * @systemapi 539261847f8eSopenharmony_ci * @since 12 539361847f8eSopenharmony_ci */ 539461847f8eSopenharmony_ci getInputSurface(): Promise<string>; 539561847f8eSopenharmony_ci /** 539661847f8eSopenharmony_ci * Starts video recording. 539761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when start completed. 539861847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 539961847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by callback. 540061847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 540161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 540261847f8eSopenharmony_ci * @systemapi 540361847f8eSopenharmony_ci * @since 9 540461847f8eSopenharmony_ci */ 540561847f8eSopenharmony_ci /** 540661847f8eSopenharmony_ci * Starts video recording. 540761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when start completed. 540861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 540961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 541061847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by callback. 541161847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 541261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 541361847f8eSopenharmony_ci * @systemapi 541461847f8eSopenharmony_ci * @since 12 541561847f8eSopenharmony_ci */ 541661847f8eSopenharmony_ci start(callback: AsyncCallback<void>): void; 541761847f8eSopenharmony_ci /** 541861847f8eSopenharmony_ci * Starts video recording. 541961847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when start completed. 542061847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 542161847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by promise. 542261847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 542361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 542461847f8eSopenharmony_ci * @systemapi 542561847f8eSopenharmony_ci * @since 9 542661847f8eSopenharmony_ci */ 542761847f8eSopenharmony_ci /** 542861847f8eSopenharmony_ci * Starts video recording. 542961847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when start completed. 543061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 543161847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 543261847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by promise. 543361847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 543461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 543561847f8eSopenharmony_ci * @systemapi 543661847f8eSopenharmony_ci * @since 12 543761847f8eSopenharmony_ci */ 543861847f8eSopenharmony_ci start(): Promise<void>; 543961847f8eSopenharmony_ci /** 544061847f8eSopenharmony_ci * Pauses video recording. 544161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when pause completed. 544261847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 544361847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by callback. 544461847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 544561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 544661847f8eSopenharmony_ci * @systemapi 544761847f8eSopenharmony_ci * @since 9 544861847f8eSopenharmony_ci */ 544961847f8eSopenharmony_ci /** 545061847f8eSopenharmony_ci * Pauses video recording. 545161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when pause completed. 545261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 545361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 545461847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by callback. 545561847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 545661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 545761847f8eSopenharmony_ci * @systemapi 545861847f8eSopenharmony_ci * @since 12 545961847f8eSopenharmony_ci */ 546061847f8eSopenharmony_ci pause(callback: AsyncCallback<void>): void; 546161847f8eSopenharmony_ci /** 546261847f8eSopenharmony_ci * Pauses video recording. 546361847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when pause completed. 546461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 546561847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by promise. 546661847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 546761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 546861847f8eSopenharmony_ci * @systemapi 546961847f8eSopenharmony_ci * @since 9 547061847f8eSopenharmony_ci */ 547161847f8eSopenharmony_ci /** 547261847f8eSopenharmony_ci * Pauses video recording. 547361847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when pause completed. 547461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 547561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 547661847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by promise. 547761847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 547861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 547961847f8eSopenharmony_ci * @systemapi 548061847f8eSopenharmony_ci * @since 12 548161847f8eSopenharmony_ci */ 548261847f8eSopenharmony_ci pause(): Promise<void>; 548361847f8eSopenharmony_ci /** 548461847f8eSopenharmony_ci * Resumes video recording. 548561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when resume completed. 548661847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 548761847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by callback. 548861847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 548961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 549061847f8eSopenharmony_ci * @systemapi 549161847f8eSopenharmony_ci * @since 9 549261847f8eSopenharmony_ci */ 549361847f8eSopenharmony_ci /** 549461847f8eSopenharmony_ci * Resumes video recording. 549561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when resume completed. 549661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 549761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 549861847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by callback. 549961847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 550061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 550161847f8eSopenharmony_ci * @systemapi 550261847f8eSopenharmony_ci * @since 12 550361847f8eSopenharmony_ci */ 550461847f8eSopenharmony_ci resume(callback: AsyncCallback<void>): void; 550561847f8eSopenharmony_ci /** 550661847f8eSopenharmony_ci * Resumes video recording. 550761847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when resume completed. 550861847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 550961847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by promise. 551061847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 551161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 551261847f8eSopenharmony_ci * @systemapi 551361847f8eSopenharmony_ci * @since 9 551461847f8eSopenharmony_ci */ 551561847f8eSopenharmony_ci /** 551661847f8eSopenharmony_ci * Resumes video recording. 551761847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when resume completed. 551861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 551961847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 552061847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by promise. 552161847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 552261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 552361847f8eSopenharmony_ci * @systemapi 552461847f8eSopenharmony_ci * @since 12 552561847f8eSopenharmony_ci */ 552661847f8eSopenharmony_ci resume(): Promise<void>; 552761847f8eSopenharmony_ci /** 552861847f8eSopenharmony_ci * Stops video recording. 552961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback A callback instance used to return when stop completed. 553061847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 553161847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by callback. 553261847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 553361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 553461847f8eSopenharmony_ci * @systemapi 553561847f8eSopenharmony_ci * @since 9 553661847f8eSopenharmony_ci */ 553761847f8eSopenharmony_ci /** 553861847f8eSopenharmony_ci * Stops video recording. 553961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback A callback instance used to return when stop completed. 554061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 554161847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. 554261847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by callback. 554361847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 554461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 554561847f8eSopenharmony_ci * @systemapi 554661847f8eSopenharmony_ci * @since 12 554761847f8eSopenharmony_ci */ 554861847f8eSopenharmony_ci stop(callback: AsyncCallback<void>): void; 554961847f8eSopenharmony_ci /** 555061847f8eSopenharmony_ci * Stops video recording. 555161847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when stop completed. 555261847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 555361847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by promise. 555461847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 555561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 555661847f8eSopenharmony_ci * @systemapi 555761847f8eSopenharmony_ci * @since 9 555861847f8eSopenharmony_ci */ 555961847f8eSopenharmony_ci /** 556061847f8eSopenharmony_ci * Stops video recording. 556161847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when stop completed. 556261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 556361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 556461847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by promise. 556561847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 556661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 556761847f8eSopenharmony_ci * @systemapi 556861847f8eSopenharmony_ci * @since 12 556961847f8eSopenharmony_ci */ 557061847f8eSopenharmony_ci stop(): Promise<void>; 557161847f8eSopenharmony_ci /** 557261847f8eSopenharmony_ci * Releases resources used for video recording. 557361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when release completed. 557461847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 557561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 557661847f8eSopenharmony_ci * @systemapi 557761847f8eSopenharmony_ci * @since 9 557861847f8eSopenharmony_ci */ 557961847f8eSopenharmony_ci /** 558061847f8eSopenharmony_ci * Releases resources used for video recording. 558161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when release completed. 558261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 558361847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 558461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 558561847f8eSopenharmony_ci * @systemapi 558661847f8eSopenharmony_ci * @since 12 558761847f8eSopenharmony_ci */ 558861847f8eSopenharmony_ci release(callback: AsyncCallback<void>): void; 558961847f8eSopenharmony_ci /** 559061847f8eSopenharmony_ci * Releases resources used for video recording. 559161847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when release completed. 559261847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 559361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 559461847f8eSopenharmony_ci * @systemapi 559561847f8eSopenharmony_ci * @since 9 559661847f8eSopenharmony_ci */ 559761847f8eSopenharmony_ci /** 559861847f8eSopenharmony_ci * Releases resources used for video recording. 559961847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when release completed. 560061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 560161847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 560261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 560361847f8eSopenharmony_ci * @systemapi 560461847f8eSopenharmony_ci * @since 12 560561847f8eSopenharmony_ci */ 560661847f8eSopenharmony_ci release(): Promise<void>; 560761847f8eSopenharmony_ci /** 560861847f8eSopenharmony_ci * Resets video recording. 560961847f8eSopenharmony_ci * Before resetting video recording, you must call stop() to stop recording. After video recording is reset, 561061847f8eSopenharmony_ci * you must call prepare() to set the recording configurations for another recording. 561161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when reset completed. 561261847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by callback. 561361847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 561461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 561561847f8eSopenharmony_ci * @systemapi 561661847f8eSopenharmony_ci * @since 9 561761847f8eSopenharmony_ci */ 561861847f8eSopenharmony_ci /** 561961847f8eSopenharmony_ci * Resets video recording. 562061847f8eSopenharmony_ci * Before resetting video recording, you must call stop() to stop recording. After video recording is reset, 562161847f8eSopenharmony_ci * you must call prepare() to set the recording configurations for another recording. 562261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when reset completed. 562361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 562461847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by callback. 562561847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 562661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 562761847f8eSopenharmony_ci * @systemapi 562861847f8eSopenharmony_ci * @since 12 562961847f8eSopenharmony_ci */ 563061847f8eSopenharmony_ci reset(callback: AsyncCallback<void>): void; 563161847f8eSopenharmony_ci /** 563261847f8eSopenharmony_ci * Resets video recording. 563361847f8eSopenharmony_ci * Before resetting video recording, you must call stop() to stop recording. After video recording is reset, 563461847f8eSopenharmony_ci * you must call prepare() to set the recording configurations for another recording. 563561847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when reset completed. 563661847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by promise. 563761847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 563861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 563961847f8eSopenharmony_ci * @systemapi 564061847f8eSopenharmony_ci * @since 9 564161847f8eSopenharmony_ci */ 564261847f8eSopenharmony_ci /** 564361847f8eSopenharmony_ci * Resets video recording. 564461847f8eSopenharmony_ci * Before resetting video recording, you must call stop() to stop recording. After video recording is reset, 564561847f8eSopenharmony_ci * you must call prepare() to set the recording configurations for another recording. 564661847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when reset completed. 564761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 564861847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by promise. 564961847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 565061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 565161847f8eSopenharmony_ci * @systemapi 565261847f8eSopenharmony_ci * @since 12 565361847f8eSopenharmony_ci */ 565461847f8eSopenharmony_ci reset(): Promise<void>; 565561847f8eSopenharmony_ci /** 565661847f8eSopenharmony_ci * Listens for video recording error events. 565761847f8eSopenharmony_ci * @param { 'error' } type - Type of the video recording error event to listen for. 565861847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the video recording error event. 565961847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by callback. 566061847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 566161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 566261847f8eSopenharmony_ci * @systemapi 566361847f8eSopenharmony_ci * @since 9 566461847f8eSopenharmony_ci */ 566561847f8eSopenharmony_ci /** 566661847f8eSopenharmony_ci * Listens for video recording error events. 566761847f8eSopenharmony_ci * @param { 'error' } type - Type of the video recording error event to listen for. 566861847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the video recording error event. 566961847f8eSopenharmony_ci * @throws { BusinessError } 201 - permission denied. 567061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not System App. 567161847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. Return by callback. 567261847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by callback. 567361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 567461847f8eSopenharmony_ci * @systemapi 567561847f8eSopenharmony_ci * @since 12 567661847f8eSopenharmony_ci */ 567761847f8eSopenharmony_ci on(type: 'error', callback: ErrorCallback): void; 567861847f8eSopenharmony_ci 567961847f8eSopenharmony_ci /** 568061847f8eSopenharmony_ci * video recorder state. 568161847f8eSopenharmony_ci * @type { VideoRecordState } 568261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 568361847f8eSopenharmony_ci * @systemapi 568461847f8eSopenharmony_ci * @since 9 568561847f8eSopenharmony_ci */ 568661847f8eSopenharmony_ci readonly state: VideoRecordState; 568761847f8eSopenharmony_ci } 568861847f8eSopenharmony_ci 568961847f8eSopenharmony_ci /** 569061847f8eSopenharmony_ci * Describes video playback states. 569161847f8eSopenharmony_ci * @typedef { 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error' } 569261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 569361847f8eSopenharmony_ci * @since 8 569461847f8eSopenharmony_ci * @deprecated since 9 569561847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayerState 569661847f8eSopenharmony_ci */ 569761847f8eSopenharmony_ci type VideoPlayState = 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error'; 569861847f8eSopenharmony_ci 569961847f8eSopenharmony_ci /** 570061847f8eSopenharmony_ci * Enumerates playback speed. 570161847f8eSopenharmony_ci * 570261847f8eSopenharmony_ci * @enum { number } 570361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 570461847f8eSopenharmony_ci * @since 8 570561847f8eSopenharmony_ci */ 570661847f8eSopenharmony_ci /** 570761847f8eSopenharmony_ci * Enumerates playback speed. 570861847f8eSopenharmony_ci * 570961847f8eSopenharmony_ci * @enum { number } 571061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 571161847f8eSopenharmony_ci * @crossplatform 571261847f8eSopenharmony_ci * @atomicservice 571361847f8eSopenharmony_ci * @since 12 571461847f8eSopenharmony_ci */ 571561847f8eSopenharmony_ci enum PlaybackSpeed { 571661847f8eSopenharmony_ci /** 571761847f8eSopenharmony_ci * playback at 0.75x normal speed 571861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 571961847f8eSopenharmony_ci * @since 8 572061847f8eSopenharmony_ci */ 572161847f8eSopenharmony_ci /** 572261847f8eSopenharmony_ci * playback at 0.75x normal speed 572361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 572461847f8eSopenharmony_ci * @crossplatform 572561847f8eSopenharmony_ci * @atomicservice 572661847f8eSopenharmony_ci * @since 12 572761847f8eSopenharmony_ci */ 572861847f8eSopenharmony_ci SPEED_FORWARD_0_75_X = 0, 572961847f8eSopenharmony_ci /** 573061847f8eSopenharmony_ci * playback at normal speed 573161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 573261847f8eSopenharmony_ci * @since 8 573361847f8eSopenharmony_ci */ 573461847f8eSopenharmony_ci /** 573561847f8eSopenharmony_ci * playback at normal speed 573661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 573761847f8eSopenharmony_ci * @crossplatform 573861847f8eSopenharmony_ci * @atomicservice 573961847f8eSopenharmony_ci * @since 12 574061847f8eSopenharmony_ci */ 574161847f8eSopenharmony_ci SPEED_FORWARD_1_00_X = 1, 574261847f8eSopenharmony_ci /** 574361847f8eSopenharmony_ci * playback at 1.25x normal speed 574461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 574561847f8eSopenharmony_ci * @since 8 574661847f8eSopenharmony_ci */ 574761847f8eSopenharmony_ci /** 574861847f8eSopenharmony_ci * playback at 1.25x normal speed 574961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 575061847f8eSopenharmony_ci * @crossplatform 575161847f8eSopenharmony_ci * @atomicservice 575261847f8eSopenharmony_ci * @since 12 575361847f8eSopenharmony_ci */ 575461847f8eSopenharmony_ci SPEED_FORWARD_1_25_X = 2, 575561847f8eSopenharmony_ci /** 575661847f8eSopenharmony_ci * playback at 1.75x normal speed 575761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 575861847f8eSopenharmony_ci * @since 8 575961847f8eSopenharmony_ci */ 576061847f8eSopenharmony_ci /** 576161847f8eSopenharmony_ci * playback at 1.75x normal speed 576261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 576361847f8eSopenharmony_ci * @crossplatform 576461847f8eSopenharmony_ci * @atomicservice 576561847f8eSopenharmony_ci * @since 12 576661847f8eSopenharmony_ci */ 576761847f8eSopenharmony_ci SPEED_FORWARD_1_75_X = 3, 576861847f8eSopenharmony_ci /** 576961847f8eSopenharmony_ci * playback at 2.0x normal speed 577061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 577161847f8eSopenharmony_ci * @since 8 577261847f8eSopenharmony_ci */ 577361847f8eSopenharmony_ci /** 577461847f8eSopenharmony_ci * playback at 2.0x normal speed 577561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 577661847f8eSopenharmony_ci * @crossplatform 577761847f8eSopenharmony_ci * @atomicservice 577861847f8eSopenharmony_ci * @since 12 577961847f8eSopenharmony_ci */ 578061847f8eSopenharmony_ci SPEED_FORWARD_2_00_X = 4, 578161847f8eSopenharmony_ci /** 578261847f8eSopenharmony_ci * playback at 0.5x normal speed 578361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 578461847f8eSopenharmony_ci * @atomicservice 578561847f8eSopenharmony_ci * @since 12 578661847f8eSopenharmony_ci */ 578761847f8eSopenharmony_ci SPEED_FORWARD_0_50_X = 5, 578861847f8eSopenharmony_ci /** 578961847f8eSopenharmony_ci * playback at 1.5x normal speed 579061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 579161847f8eSopenharmony_ci * @atomicservice 579261847f8eSopenharmony_ci * @since 12 579361847f8eSopenharmony_ci */ 579461847f8eSopenharmony_ci SPEED_FORWARD_1_50_X = 6, 579561847f8eSopenharmony_ci /** 579661847f8eSopenharmony_ci * playback at 3.0x normal speed 579761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 579861847f8eSopenharmony_ci * @atomicservice 579961847f8eSopenharmony_ci * @since 13 580061847f8eSopenharmony_ci */ 580161847f8eSopenharmony_ci SPEED_FORWARD_3_00_X = 7, 580261847f8eSopenharmony_ci /** 580361847f8eSopenharmony_ci * playback at 0.25x normal speed 580461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 580561847f8eSopenharmony_ci * @atomicservice 580661847f8eSopenharmony_ci * @since 12 580761847f8eSopenharmony_ci */ 580861847f8eSopenharmony_ci SPEED_FORWARD_0_25_X = 8, 580961847f8eSopenharmony_ci /** 581061847f8eSopenharmony_ci * playback at 0.125x normal speed 581161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 581261847f8eSopenharmony_ci * @atomicservice 581361847f8eSopenharmony_ci * @since 12 581461847f8eSopenharmony_ci */ 581561847f8eSopenharmony_ci SPEED_FORWARD_0_125_X = 9, 581661847f8eSopenharmony_ci } 581761847f8eSopenharmony_ci 581861847f8eSopenharmony_ci /** 581961847f8eSopenharmony_ci * Manages and plays video. Before calling an video method, you must use createVideoPlayer() to create an VideoPlayer 582061847f8eSopenharmony_ci * instance. 582161847f8eSopenharmony_ci * 582261847f8eSopenharmony_ci * @typedef VideoPlayer 582361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 582461847f8eSopenharmony_ci * @since 8 582561847f8eSopenharmony_ci * @deprecated since 9 582661847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer 582761847f8eSopenharmony_ci */ 582861847f8eSopenharmony_ci interface VideoPlayer { 582961847f8eSopenharmony_ci /** 583061847f8eSopenharmony_ci * Set display surface. 583161847f8eSopenharmony_ci * @param {string} surfaceId - surface id, video player will use this id get a surface instance. 583261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when release output buffer completed. 583361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 583461847f8eSopenharmony_ci * @since 8 583561847f8eSopenharmony_ci * @deprecated since 9 583661847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#surfaceId 583761847f8eSopenharmony_ci */ 583861847f8eSopenharmony_ci setDisplaySurface(surfaceId: string, callback: AsyncCallback<void>): void; 583961847f8eSopenharmony_ci /** 584061847f8eSopenharmony_ci * Set display surface. 584161847f8eSopenharmony_ci * @param {string} surfaceId - surface id, video player will use this id get a surface instance. 584261847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when release output buffer completed. 584361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 584461847f8eSopenharmony_ci * @since 8 584561847f8eSopenharmony_ci * @deprecated since 9 584661847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#surfaceId 584761847f8eSopenharmony_ci */ 584861847f8eSopenharmony_ci setDisplaySurface(surfaceId: string): Promise<void>; 584961847f8eSopenharmony_ci /** 585061847f8eSopenharmony_ci * Prepare video playback, it will request resource for playing. 585161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when prepare completed. 585261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 585361847f8eSopenharmony_ci * @since 8 585461847f8eSopenharmony_ci * @deprecated since 9 585561847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#prepare 585661847f8eSopenharmony_ci */ 585761847f8eSopenharmony_ci prepare(callback: AsyncCallback<void>): void; 585861847f8eSopenharmony_ci /** 585961847f8eSopenharmony_ci * Prepare video playback, it will request resource for playing. 586061847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when prepare completed. 586161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 586261847f8eSopenharmony_ci * @since 8 586361847f8eSopenharmony_ci * @deprecated since 9 586461847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#prepare 586561847f8eSopenharmony_ci */ 586661847f8eSopenharmony_ci prepare(): Promise<void>; 586761847f8eSopenharmony_ci /** 586861847f8eSopenharmony_ci * Starts video playback. 586961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when start completed. 587061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 587161847f8eSopenharmony_ci * @since 8 587261847f8eSopenharmony_ci * @deprecated since 9 587361847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#play 587461847f8eSopenharmony_ci */ 587561847f8eSopenharmony_ci play(callback: AsyncCallback<void>): void; 587661847f8eSopenharmony_ci /** 587761847f8eSopenharmony_ci * Starts video playback. 587861847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when start completed. 587961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 588061847f8eSopenharmony_ci * @since 8 588161847f8eSopenharmony_ci * @deprecated since 9 588261847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#play 588361847f8eSopenharmony_ci */ 588461847f8eSopenharmony_ci play(): Promise<void>; 588561847f8eSopenharmony_ci /** 588661847f8eSopenharmony_ci * Pauses video playback. 588761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when pause completed. 588861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 588961847f8eSopenharmony_ci * @since 8 589061847f8eSopenharmony_ci * @deprecated since 9 589161847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#pause 589261847f8eSopenharmony_ci */ 589361847f8eSopenharmony_ci pause(callback: AsyncCallback<void>): void; 589461847f8eSopenharmony_ci /** 589561847f8eSopenharmony_ci * Pauses video playback. 589661847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when pause completed. 589761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 589861847f8eSopenharmony_ci * @since 8 589961847f8eSopenharmony_ci * @deprecated since 9 590061847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#pause 590161847f8eSopenharmony_ci */ 590261847f8eSopenharmony_ci pause(): Promise<void>; 590361847f8eSopenharmony_ci /** 590461847f8eSopenharmony_ci * Stops video playback. 590561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when stop completed. 590661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 590761847f8eSopenharmony_ci * @since 8 590861847f8eSopenharmony_ci * @deprecated since 9 590961847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#stop 591061847f8eSopenharmony_ci */ 591161847f8eSopenharmony_ci stop(callback: AsyncCallback<void>): void; 591261847f8eSopenharmony_ci /** 591361847f8eSopenharmony_ci * Stops video playback. 591461847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when stop completed. 591561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 591661847f8eSopenharmony_ci * @since 8 591761847f8eSopenharmony_ci * @deprecated since 9 591861847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#stop 591961847f8eSopenharmony_ci */ 592061847f8eSopenharmony_ci stop(): Promise<void>; 592161847f8eSopenharmony_ci /** 592261847f8eSopenharmony_ci * Resets video playback, it will release the resource. 592361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when reset completed. 592461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 592561847f8eSopenharmony_ci * @since 8 592661847f8eSopenharmony_ci * @deprecated since 9 592761847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#reset 592861847f8eSopenharmony_ci */ 592961847f8eSopenharmony_ci reset(callback: AsyncCallback<void>): void; 593061847f8eSopenharmony_ci /** 593161847f8eSopenharmony_ci * Resets video playback, it will release the resource. 593261847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when reset completed. 593361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 593461847f8eSopenharmony_ci * @since 8 593561847f8eSopenharmony_ci * @deprecated since 9 593661847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#reset 593761847f8eSopenharmony_ci */ 593861847f8eSopenharmony_ci reset(): Promise<void>; 593961847f8eSopenharmony_ci /** 594061847f8eSopenharmony_ci * Jumps to the specified playback position by default SeekMode(SEEK_PREV_SYNC), 594161847f8eSopenharmony_ci * the performance may be not the best. 594261847f8eSopenharmony_ci * @param { number } timeMs - Playback position to jump 594361847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - A callback instance used to return when seek completed 594461847f8eSopenharmony_ci * and return the seeking position result. 594561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 594661847f8eSopenharmony_ci * @since 8 594761847f8eSopenharmony_ci * @deprecated since 9 594861847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#seek 594961847f8eSopenharmony_ci */ 595061847f8eSopenharmony_ci seek(timeMs: number, callback: AsyncCallback<number>): void; 595161847f8eSopenharmony_ci /** 595261847f8eSopenharmony_ci * Jumps to the specified playback position. 595361847f8eSopenharmony_ci * @param { number } timeMs - Playback position to jump 595461847f8eSopenharmony_ci * @param { SeekMode } mode - seek mode, see @SeekMode . 595561847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - A callback instance used to return when seek completed 595661847f8eSopenharmony_ci * and return the seeking position result. 595761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 595861847f8eSopenharmony_ci * @since 8 595961847f8eSopenharmony_ci * @deprecated since 9 596061847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#seek 596161847f8eSopenharmony_ci */ 596261847f8eSopenharmony_ci seek(timeMs: number, mode: SeekMode, callback: AsyncCallback<number>): void; 596361847f8eSopenharmony_ci /** 596461847f8eSopenharmony_ci * Jumps to the specified playback position. 596561847f8eSopenharmony_ci * @param { number } timeMs - Playback position to jump 596661847f8eSopenharmony_ci * @param { SeekMode } mode - seek mode, see @SeekMode . 596761847f8eSopenharmony_ci * @returns { Promise<number> } A Promise instance used to return when seek completed 596861847f8eSopenharmony_ci * and return the seeking position result. 596961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 597061847f8eSopenharmony_ci * @since 8 597161847f8eSopenharmony_ci * @deprecated since 9 597261847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#seek 597361847f8eSopenharmony_ci */ 597461847f8eSopenharmony_ci seek(timeMs: number, mode?: SeekMode): Promise<number>; 597561847f8eSopenharmony_ci /** 597661847f8eSopenharmony_ci * Sets the volume. 597761847f8eSopenharmony_ci * @param { number } vol - Relative volume. The value ranges from 0.00 to 1.00. The value 1 indicates the maximum volume (100%). 597861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when set volume completed. 597961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 598061847f8eSopenharmony_ci * @since 8 598161847f8eSopenharmony_ci * @deprecated since 9 598261847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#setVolume 598361847f8eSopenharmony_ci */ 598461847f8eSopenharmony_ci setVolume(vol: number, callback: AsyncCallback<void>): void; 598561847f8eSopenharmony_ci /** 598661847f8eSopenharmony_ci * Sets the volume. 598761847f8eSopenharmony_ci * @param { number } vol - Relative volume. The value ranges from 0.00 to 1.00. The value 1 indicates the maximum volume (100%). 598861847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when set volume completed. 598961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 599061847f8eSopenharmony_ci * @since 8 599161847f8eSopenharmony_ci * @deprecated since 9 599261847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#setVolume 599361847f8eSopenharmony_ci */ 599461847f8eSopenharmony_ci setVolume(vol: number): Promise<void>; 599561847f8eSopenharmony_ci /** 599661847f8eSopenharmony_ci * Releases resources used for video playback. 599761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - A callback instance used to return when release completed. 599861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 599961847f8eSopenharmony_ci * @since 8 600061847f8eSopenharmony_ci * @deprecated since 9 600161847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#release 600261847f8eSopenharmony_ci */ 600361847f8eSopenharmony_ci release(callback: AsyncCallback<void>): void; 600461847f8eSopenharmony_ci /** 600561847f8eSopenharmony_ci * Releases resources used for video playback. 600661847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when release completed. 600761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 600861847f8eSopenharmony_ci * @since 8 600961847f8eSopenharmony_ci * @deprecated since 9 601061847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#release 601161847f8eSopenharmony_ci */ 601261847f8eSopenharmony_ci release(): Promise<void>; 601361847f8eSopenharmony_ci /** 601461847f8eSopenharmony_ci * Get all track infos in MediaDescription, should be called after data loaded callback. 601561847f8eSopenharmony_ci * @param { AsyncCallback<Array<MediaDescription>> } callback - async callback return track info in MediaDescription. 601661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 601761847f8eSopenharmony_ci * @since 8 601861847f8eSopenharmony_ci * @deprecated since 9 601961847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#getTrackDescription 602061847f8eSopenharmony_ci */ 602161847f8eSopenharmony_ci getTrackDescription(callback: AsyncCallback<Array<MediaDescription>>): void; 602261847f8eSopenharmony_ci 602361847f8eSopenharmony_ci /** 602461847f8eSopenharmony_ci * Get all track infos in MediaDescription, should be called after data loaded callback. 602561847f8eSopenharmony_ci * @returns { Promise<Array<MediaDescription>> } A Promise instance used to return the track info in MediaDescription. 602661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 602761847f8eSopenharmony_ci * @since 8 602861847f8eSopenharmony_ci * @deprecated since 9 602961847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#getTrackDescription 603061847f8eSopenharmony_ci */ 603161847f8eSopenharmony_ci getTrackDescription(): Promise<Array<MediaDescription>>; 603261847f8eSopenharmony_ci 603361847f8eSopenharmony_ci /** 603461847f8eSopenharmony_ci * media url. Mainstream video formats are supported. 603561847f8eSopenharmony_ci * local:fd://XXX, file://XXX. network:http://xxx 603661847f8eSopenharmony_ci * @type { string } 603761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 603861847f8eSopenharmony_ci * @since 8 603961847f8eSopenharmony_ci * @deprecated since 9 604061847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#url 604161847f8eSopenharmony_ci */ 604261847f8eSopenharmony_ci url: string; 604361847f8eSopenharmony_ci 604461847f8eSopenharmony_ci /** 604561847f8eSopenharmony_ci * Video file descriptor. Mainstream video formats are supported. 604661847f8eSopenharmony_ci * @type { AVFileDescriptor } 604761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 604861847f8eSopenharmony_ci * @since 9 604961847f8eSopenharmony_ci * @deprecated since 9 605061847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#fdSrc 605161847f8eSopenharmony_ci */ 605261847f8eSopenharmony_ci fdSrc: AVFileDescriptor; 605361847f8eSopenharmony_ci 605461847f8eSopenharmony_ci /** 605561847f8eSopenharmony_ci * Whether to loop video playback. The value true means to loop playback. 605661847f8eSopenharmony_ci * @type { boolean } 605761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 605861847f8eSopenharmony_ci * @since 8 605961847f8eSopenharmony_ci * @deprecated since 9 606061847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#loop 606161847f8eSopenharmony_ci */ 606261847f8eSopenharmony_ci loop: boolean; 606361847f8eSopenharmony_ci 606461847f8eSopenharmony_ci /** 606561847f8eSopenharmony_ci * Current playback position. 606661847f8eSopenharmony_ci * @type { number } 606761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 606861847f8eSopenharmony_ci * @since 8 606961847f8eSopenharmony_ci * @deprecated since 9 607061847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#currentTime 607161847f8eSopenharmony_ci */ 607261847f8eSopenharmony_ci readonly currentTime: number; 607361847f8eSopenharmony_ci 607461847f8eSopenharmony_ci /** 607561847f8eSopenharmony_ci * Playback duration, if -1 means cannot seek. 607661847f8eSopenharmony_ci * @type { number } 607761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 607861847f8eSopenharmony_ci * @since 8 607961847f8eSopenharmony_ci * @deprecated since 9 608061847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#duration 608161847f8eSopenharmony_ci */ 608261847f8eSopenharmony_ci readonly duration: number; 608361847f8eSopenharmony_ci 608461847f8eSopenharmony_ci /** 608561847f8eSopenharmony_ci * Playback state. 608661847f8eSopenharmony_ci * @type { VideoPlayState } 608761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 608861847f8eSopenharmony_ci * @since 8 608961847f8eSopenharmony_ci * @deprecated since 9 609061847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#state 609161847f8eSopenharmony_ci */ 609261847f8eSopenharmony_ci readonly state: VideoPlayState; 609361847f8eSopenharmony_ci 609461847f8eSopenharmony_ci /** 609561847f8eSopenharmony_ci * video width, valid after prepared. 609661847f8eSopenharmony_ci * @type { number } 609761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 609861847f8eSopenharmony_ci * @since 8 609961847f8eSopenharmony_ci * @deprecated since 9 610061847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#width 610161847f8eSopenharmony_ci */ 610261847f8eSopenharmony_ci readonly width: number; 610361847f8eSopenharmony_ci 610461847f8eSopenharmony_ci /** 610561847f8eSopenharmony_ci * video height, valid after prepared. 610661847f8eSopenharmony_ci * @type { number } 610761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 610861847f8eSopenharmony_ci * @since 8 610961847f8eSopenharmony_ci * @deprecated since 9 611061847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#height 611161847f8eSopenharmony_ci */ 611261847f8eSopenharmony_ci readonly height: number; 611361847f8eSopenharmony_ci 611461847f8eSopenharmony_ci /** 611561847f8eSopenharmony_ci * Describes audio interrupt mode, refer to {@link #audio.InterruptMode}. If it is not 611661847f8eSopenharmony_ci * set, the default mode will be used. Set it before calling the {@link #play()} in the 611761847f8eSopenharmony_ci * first time in order for the interrupt mode to become effective thereafter. 611861847f8eSopenharmony_ci * @type { ?audio.InterruptMode } 611961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 612061847f8eSopenharmony_ci * @since 9 612161847f8eSopenharmony_ci * @deprecated since 9 612261847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#audioInterruptMode 612361847f8eSopenharmony_ci */ 612461847f8eSopenharmony_ci audioInterruptMode?: audio.InterruptMode; 612561847f8eSopenharmony_ci 612661847f8eSopenharmony_ci /** 612761847f8eSopenharmony_ci * video scale type. By default, the {@link #VIDEO_SCALE_TYPE_FIT} will be used, for more 612861847f8eSopenharmony_ci * information, refer to {@link #VideoScaleType} 612961847f8eSopenharmony_ci * @type { ?VideoScaleType } 613061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 613161847f8eSopenharmony_ci * @since 9 613261847f8eSopenharmony_ci * @deprecated since 9 613361847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#videoScaleType 613461847f8eSopenharmony_ci */ 613561847f8eSopenharmony_ci videoScaleType?: VideoScaleType; 613661847f8eSopenharmony_ci 613761847f8eSopenharmony_ci /** 613861847f8eSopenharmony_ci * set payback speed. 613961847f8eSopenharmony_ci * @param { number } speed - playback speed, see @PlaybackSpeed . 614061847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback Callback used to return actually speed. 614161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 614261847f8eSopenharmony_ci * @since 8 614361847f8eSopenharmony_ci * @deprecated since 9 614461847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#setSpeed 614561847f8eSopenharmony_ci */ 614661847f8eSopenharmony_ci setSpeed(speed: number, callback: AsyncCallback<number>): void; 614761847f8eSopenharmony_ci /** 614861847f8eSopenharmony_ci * set output surface. 614961847f8eSopenharmony_ci * @param { number } speed - playback speed, see @PlaybackSpeed . 615061847f8eSopenharmony_ci * @returns { Promise<number> } A Promise instance used to return actually speed. 615161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 615261847f8eSopenharmony_ci * @since 8 615361847f8eSopenharmony_ci * @deprecated since 9 615461847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#setSpeed 615561847f8eSopenharmony_ci */ 615661847f8eSopenharmony_ci setSpeed(speed: number): Promise<number>; 615761847f8eSopenharmony_ci 615861847f8eSopenharmony_ci /** 615961847f8eSopenharmony_ci * Listens for video playback completed events. 616061847f8eSopenharmony_ci * @param { 'playbackCompleted' } type - Type of the playback event to listen for. 616161847f8eSopenharmony_ci * @param { Callback<void> } callback - Callback used to listen for the playback event return. 616261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 616361847f8eSopenharmony_ci * @since 8 616461847f8eSopenharmony_ci * @deprecated since 9 616561847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#event:stateChange 616661847f8eSopenharmony_ci */ 616761847f8eSopenharmony_ci on(type: 'playbackCompleted', callback: Callback<void>): void; 616861847f8eSopenharmony_ci 616961847f8eSopenharmony_ci /** 617061847f8eSopenharmony_ci * Listens for video playback buffering events. 617161847f8eSopenharmony_ci * @param { 'bufferingUpdate' } type - Type of the playback buffering update event to listen for. 617261847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the buffering update event, 617361847f8eSopenharmony_ci * return BufferingInfoType and the value. 617461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 617561847f8eSopenharmony_ci * @since 8 617661847f8eSopenharmony_ci * @deprecated since 9 617761847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#event:bufferingUpdate 617861847f8eSopenharmony_ci */ 617961847f8eSopenharmony_ci on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void; 618061847f8eSopenharmony_ci 618161847f8eSopenharmony_ci /** 618261847f8eSopenharmony_ci * Listens for start render video frame events. 618361847f8eSopenharmony_ci * @param { 'startRenderFrame' } type - Type of the playback event to listen for. 618461847f8eSopenharmony_ci * @param { Callback<void> } callback - Callback used to listen for the playback event return. 618561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 618661847f8eSopenharmony_ci * @since 8 618761847f8eSopenharmony_ci * @deprecated since 9 618861847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#event:startRenderFrame 618961847f8eSopenharmony_ci */ 619061847f8eSopenharmony_ci on(type: 'startRenderFrame', callback: Callback<void>): void; 619161847f8eSopenharmony_ci 619261847f8eSopenharmony_ci /** 619361847f8eSopenharmony_ci * Listens for video size changed event. 619461847f8eSopenharmony_ci * @param { 'videoSizeChanged' } type - Type of the playback event to listen for. 619561847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the playback event return video size. 619661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 619761847f8eSopenharmony_ci * @since 8 619861847f8eSopenharmony_ci * @deprecated since 9 619961847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#event:videoSizeChange 620061847f8eSopenharmony_ci */ 620161847f8eSopenharmony_ci on(type: 'videoSizeChanged', callback: (width: number, height: number) => void): void; 620261847f8eSopenharmony_ci 620361847f8eSopenharmony_ci /** 620461847f8eSopenharmony_ci * Listens for audio interrupt event, refer to {@link #audio.InterruptEvent} 620561847f8eSopenharmony_ci * @param { 'audioInterrupt' } type - Type of the playback event to listen for. 620661847f8eSopenharmony_ci * @param { function } callback - Callback used to listen for the playback event return audio interrupt info. 620761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 620861847f8eSopenharmony_ci * @since 9 620961847f8eSopenharmony_ci * @deprecated since 9 621061847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#event:audioInterrupt 621161847f8eSopenharmony_ci */ 621261847f8eSopenharmony_ci on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void; 621361847f8eSopenharmony_ci 621461847f8eSopenharmony_ci /** 621561847f8eSopenharmony_ci * Listens for playback error events. 621661847f8eSopenharmony_ci * @param { 'error' } type - Type of the playback error event to listen for. 621761847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the playback error event. 621861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 621961847f8eSopenharmony_ci * @since 8 622061847f8eSopenharmony_ci * @deprecated since 9 622161847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVPlayer#event:error 622261847f8eSopenharmony_ci */ 622361847f8eSopenharmony_ci on(type: 'error', callback: ErrorCallback): void; 622461847f8eSopenharmony_ci } 622561847f8eSopenharmony_ci 622661847f8eSopenharmony_ci /** 622761847f8eSopenharmony_ci * Enumerates video scale type. 622861847f8eSopenharmony_ci * 622961847f8eSopenharmony_ci * @enum { number } 623061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 623161847f8eSopenharmony_ci * @since 9 623261847f8eSopenharmony_ci */ 623361847f8eSopenharmony_ci /** 623461847f8eSopenharmony_ci * Enumerates video scale type. 623561847f8eSopenharmony_ci * 623661847f8eSopenharmony_ci * @enum { number } 623761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 623861847f8eSopenharmony_ci * @crossplatform 623961847f8eSopenharmony_ci * @atomicservice 624061847f8eSopenharmony_ci * @since 12 624161847f8eSopenharmony_ci */ 624261847f8eSopenharmony_ci enum VideoScaleType { 624361847f8eSopenharmony_ci /** 624461847f8eSopenharmony_ci * The content is stretched to the fit the display surface rendering area. When 624561847f8eSopenharmony_ci * the aspect ratio of the content is not same as the display surface, the aspect 624661847f8eSopenharmony_ci * of the content is not maintained. This is the default scale type. 624761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 624861847f8eSopenharmony_ci * @since 9 624961847f8eSopenharmony_ci */ 625061847f8eSopenharmony_ci /** 625161847f8eSopenharmony_ci * The content is stretched to the fit the display surface rendering area. When 625261847f8eSopenharmony_ci * the aspect ratio of the content is not same as the display surface, the aspect 625361847f8eSopenharmony_ci * of the content is not maintained. This is the default scale type. 625461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 625561847f8eSopenharmony_ci * @crossplatform 625661847f8eSopenharmony_ci * @atomicservice 625761847f8eSopenharmony_ci * @since 12 625861847f8eSopenharmony_ci */ 625961847f8eSopenharmony_ci VIDEO_SCALE_TYPE_FIT = 0, 626061847f8eSopenharmony_ci 626161847f8eSopenharmony_ci /** 626261847f8eSopenharmony_ci * The content is stretched to the fit the display surface rendering area. When 626361847f8eSopenharmony_ci * the aspect ratio of the content is not the same as the display surface, content's 626461847f8eSopenharmony_ci * aspect ratio is maintained and the content is cropped to fit the display surface. 626561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 626661847f8eSopenharmony_ci * @since 9 626761847f8eSopenharmony_ci */ 626861847f8eSopenharmony_ci /** 626961847f8eSopenharmony_ci * The content is stretched to the fit the display surface rendering area. When 627061847f8eSopenharmony_ci * the aspect ratio of the content is not the same as the display surface, content's 627161847f8eSopenharmony_ci * aspect ratio is maintained and the content is cropped to fit the display surface. 627261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoPlayer 627361847f8eSopenharmony_ci * @crossplatform 627461847f8eSopenharmony_ci * @atomicservice 627561847f8eSopenharmony_ci * @since 12 627661847f8eSopenharmony_ci */ 627761847f8eSopenharmony_ci VIDEO_SCALE_TYPE_FIT_CROP = 1, 627861847f8eSopenharmony_ci } 627961847f8eSopenharmony_ci 628061847f8eSopenharmony_ci /** 628161847f8eSopenharmony_ci * Enumerates container format type(The abbreviation for 'container format type' is CFT). 628261847f8eSopenharmony_ci * 628361847f8eSopenharmony_ci * @enum { number } 628461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 628561847f8eSopenharmony_ci * @since 8 628661847f8eSopenharmony_ci */ 628761847f8eSopenharmony_ci /** 628861847f8eSopenharmony_ci * Enumerates container format type(The abbreviation for 'container format type' is CFT). 628961847f8eSopenharmony_ci * 629061847f8eSopenharmony_ci * @enum { number } 629161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 629261847f8eSopenharmony_ci * @crossplatform 629361847f8eSopenharmony_ci * @atomicservice 629461847f8eSopenharmony_ci * @since 12 629561847f8eSopenharmony_ci */ 629661847f8eSopenharmony_ci enum ContainerFormatType { 629761847f8eSopenharmony_ci /** 629861847f8eSopenharmony_ci * A video container format type mp4. 629961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 630061847f8eSopenharmony_ci * @since 8 630161847f8eSopenharmony_ci */ 630261847f8eSopenharmony_ci /** 630361847f8eSopenharmony_ci * A video container format type mp4. 630461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 630561847f8eSopenharmony_ci * @crossplatform 630661847f8eSopenharmony_ci * @since 12 630761847f8eSopenharmony_ci */ 630861847f8eSopenharmony_ci CFT_MPEG_4 = 'mp4', 630961847f8eSopenharmony_ci 631061847f8eSopenharmony_ci /** 631161847f8eSopenharmony_ci * A audio container format type m4a. 631261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 631361847f8eSopenharmony_ci * @since 8 631461847f8eSopenharmony_ci */ 631561847f8eSopenharmony_ci /** 631661847f8eSopenharmony_ci * A audio container format type m4a. 631761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 631861847f8eSopenharmony_ci * @crossplatform 631961847f8eSopenharmony_ci * @atomicservice 632061847f8eSopenharmony_ci * @since 12 632161847f8eSopenharmony_ci */ 632261847f8eSopenharmony_ci CFT_MPEG_4A = 'm4a', 632361847f8eSopenharmony_ci 632461847f8eSopenharmony_ci /** 632561847f8eSopenharmony_ci * A audio container format type mp3. 632661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 632761847f8eSopenharmony_ci * @since 12 632861847f8eSopenharmony_ci */ 632961847f8eSopenharmony_ci CFT_MP3 = 'mp3', 633061847f8eSopenharmony_ci /** 633161847f8eSopenharmony_ci * A audio container format type wav. 633261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 633361847f8eSopenharmony_ci * @since 12 633461847f8eSopenharmony_ci */ 633561847f8eSopenharmony_ci CFT_WAV = 'wav', 633661847f8eSopenharmony_ci } 633761847f8eSopenharmony_ci 633861847f8eSopenharmony_ci /** 633961847f8eSopenharmony_ci * Enumerates media data type. 634061847f8eSopenharmony_ci * 634161847f8eSopenharmony_ci * @enum { number } 634261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 634361847f8eSopenharmony_ci * @since 8 634461847f8eSopenharmony_ci */ 634561847f8eSopenharmony_ci /** 634661847f8eSopenharmony_ci * Enumerates media data type. 634761847f8eSopenharmony_ci * 634861847f8eSopenharmony_ci * @enum { number } 634961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 635061847f8eSopenharmony_ci * @atomicservice 635161847f8eSopenharmony_ci * @since 11 635261847f8eSopenharmony_ci */ 635361847f8eSopenharmony_ci /** 635461847f8eSopenharmony_ci * Enumerates media data type. 635561847f8eSopenharmony_ci * 635661847f8eSopenharmony_ci * @enum { number } 635761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 635861847f8eSopenharmony_ci * @crossplatform 635961847f8eSopenharmony_ci * @atomicservice 636061847f8eSopenharmony_ci * @since 12 636161847f8eSopenharmony_ci */ 636261847f8eSopenharmony_ci enum MediaType { 636361847f8eSopenharmony_ci /** 636461847f8eSopenharmony_ci * track is audio. 636561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 636661847f8eSopenharmony_ci * @since 8 636761847f8eSopenharmony_ci */ 636861847f8eSopenharmony_ci /** 636961847f8eSopenharmony_ci * track is audio. 637061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 637161847f8eSopenharmony_ci * @atomicservice 637261847f8eSopenharmony_ci * @since 11 637361847f8eSopenharmony_ci */ 637461847f8eSopenharmony_ci /** 637561847f8eSopenharmony_ci * track is audio. 637661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 637761847f8eSopenharmony_ci * @crossplatform 637861847f8eSopenharmony_ci * @atomicservice 637961847f8eSopenharmony_ci * @since 12 638061847f8eSopenharmony_ci */ 638161847f8eSopenharmony_ci MEDIA_TYPE_AUD = 0, 638261847f8eSopenharmony_ci /** 638361847f8eSopenharmony_ci * track is video. 638461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 638561847f8eSopenharmony_ci * @since 8 638661847f8eSopenharmony_ci */ 638761847f8eSopenharmony_ci /** 638861847f8eSopenharmony_ci * track is video. 638961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 639061847f8eSopenharmony_ci * @atomicservice 639161847f8eSopenharmony_ci * @since 11 639261847f8eSopenharmony_ci */ 639361847f8eSopenharmony_ci /** 639461847f8eSopenharmony_ci * track is video. 639561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 639661847f8eSopenharmony_ci * @crossplatform 639761847f8eSopenharmony_ci * @atomicservice 639861847f8eSopenharmony_ci * @since 12 639961847f8eSopenharmony_ci */ 640061847f8eSopenharmony_ci MEDIA_TYPE_VID = 1, 640161847f8eSopenharmony_ci /** 640261847f8eSopenharmony_ci * Track is subtitle. 640361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 640461847f8eSopenharmony_ci * @atomicservice 640561847f8eSopenharmony_ci * @since 12 640661847f8eSopenharmony_ci */ 640761847f8eSopenharmony_ci MEDIA_TYPE_SUBTITLE = 2, 640861847f8eSopenharmony_ci } 640961847f8eSopenharmony_ci 641061847f8eSopenharmony_ci /** 641161847f8eSopenharmony_ci * Enumerates media description key. 641261847f8eSopenharmony_ci * 641361847f8eSopenharmony_ci * @enum { number } 641461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 641561847f8eSopenharmony_ci * @since 8 641661847f8eSopenharmony_ci */ 641761847f8eSopenharmony_ci /** 641861847f8eSopenharmony_ci * Enumerates media description key. 641961847f8eSopenharmony_ci * 642061847f8eSopenharmony_ci * @enum { number } 642161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 642261847f8eSopenharmony_ci * @atomicservice 642361847f8eSopenharmony_ci * @since 11 642461847f8eSopenharmony_ci */ 642561847f8eSopenharmony_ci /** 642661847f8eSopenharmony_ci * Enumerates media description key. 642761847f8eSopenharmony_ci * 642861847f8eSopenharmony_ci * @enum { number } 642961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 643061847f8eSopenharmony_ci * @crossplatform 643161847f8eSopenharmony_ci * @atomicservice 643261847f8eSopenharmony_ci * @since 12 643361847f8eSopenharmony_ci */ 643461847f8eSopenharmony_ci enum MediaDescriptionKey { 643561847f8eSopenharmony_ci /** 643661847f8eSopenharmony_ci * key for track index, value type is number. 643761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 643861847f8eSopenharmony_ci * @since 8 643961847f8eSopenharmony_ci */ 644061847f8eSopenharmony_ci /** 644161847f8eSopenharmony_ci * key for track index, value type is number. 644261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 644361847f8eSopenharmony_ci * @atomicservice 644461847f8eSopenharmony_ci * @since 11 644561847f8eSopenharmony_ci */ 644661847f8eSopenharmony_ci /** 644761847f8eSopenharmony_ci * key for track index, value type is number. 644861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 644961847f8eSopenharmony_ci * @crossplatform 645061847f8eSopenharmony_ci * @atomicservice 645161847f8eSopenharmony_ci * @since 12 645261847f8eSopenharmony_ci */ 645361847f8eSopenharmony_ci MD_KEY_TRACK_INDEX = 'track_index', 645461847f8eSopenharmony_ci 645561847f8eSopenharmony_ci /** 645661847f8eSopenharmony_ci * key for track type, value type is number, see @MediaType. 645761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 645861847f8eSopenharmony_ci * @since 8 645961847f8eSopenharmony_ci */ 646061847f8eSopenharmony_ci /** 646161847f8eSopenharmony_ci * key for track type, value type is number, see @MediaType. 646261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 646361847f8eSopenharmony_ci * @atomicservice 646461847f8eSopenharmony_ci * @since 11 646561847f8eSopenharmony_ci */ 646661847f8eSopenharmony_ci /** 646761847f8eSopenharmony_ci * key for track type, value type is number, see @MediaType. 646861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 646961847f8eSopenharmony_ci * @crossplatform 647061847f8eSopenharmony_ci * @atomicservice 647161847f8eSopenharmony_ci * @since 12 647261847f8eSopenharmony_ci */ 647361847f8eSopenharmony_ci MD_KEY_TRACK_TYPE = 'track_type', 647461847f8eSopenharmony_ci 647561847f8eSopenharmony_ci /** 647661847f8eSopenharmony_ci * key for codec mime type, value type is string. 647761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 647861847f8eSopenharmony_ci * @since 8 647961847f8eSopenharmony_ci */ 648061847f8eSopenharmony_ci /** 648161847f8eSopenharmony_ci * key for codec mime type, value type is string. 648261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 648361847f8eSopenharmony_ci * @atomicservice 648461847f8eSopenharmony_ci * @since 11 648561847f8eSopenharmony_ci */ 648661847f8eSopenharmony_ci /** 648761847f8eSopenharmony_ci * key for codec mime type, value type is string. 648861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 648961847f8eSopenharmony_ci * @crossplatform 649061847f8eSopenharmony_ci * @atomicservice 649161847f8eSopenharmony_ci * @since 12 649261847f8eSopenharmony_ci */ 649361847f8eSopenharmony_ci MD_KEY_CODEC_MIME = 'codec_mime', 649461847f8eSopenharmony_ci 649561847f8eSopenharmony_ci /** 649661847f8eSopenharmony_ci * key for duration, value type is number. 649761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 649861847f8eSopenharmony_ci * @since 8 649961847f8eSopenharmony_ci */ 650061847f8eSopenharmony_ci /** 650161847f8eSopenharmony_ci * key for duration, value type is number. 650261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 650361847f8eSopenharmony_ci * @atomicservice 650461847f8eSopenharmony_ci * @since 11 650561847f8eSopenharmony_ci */ 650661847f8eSopenharmony_ci /** 650761847f8eSopenharmony_ci * key for duration, value type is number. 650861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 650961847f8eSopenharmony_ci * @crossplatform 651061847f8eSopenharmony_ci * @atomicservice 651161847f8eSopenharmony_ci * @since 12 651261847f8eSopenharmony_ci */ 651361847f8eSopenharmony_ci MD_KEY_DURATION = 'duration', 651461847f8eSopenharmony_ci 651561847f8eSopenharmony_ci /** 651661847f8eSopenharmony_ci * key for bitrate, value type is number. 651761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 651861847f8eSopenharmony_ci * @since 8 651961847f8eSopenharmony_ci */ 652061847f8eSopenharmony_ci /** 652161847f8eSopenharmony_ci * key for bitrate, value type is number. 652261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 652361847f8eSopenharmony_ci * @atomicservice 652461847f8eSopenharmony_ci * @since 11 652561847f8eSopenharmony_ci */ 652661847f8eSopenharmony_ci /** 652761847f8eSopenharmony_ci * key for bitrate, value type is number. 652861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 652961847f8eSopenharmony_ci * @crossplatform 653061847f8eSopenharmony_ci * @atomicservice 653161847f8eSopenharmony_ci * @since 12 653261847f8eSopenharmony_ci */ 653361847f8eSopenharmony_ci MD_KEY_BITRATE = 'bitrate', 653461847f8eSopenharmony_ci 653561847f8eSopenharmony_ci /** 653661847f8eSopenharmony_ci * key for video width, value type is number. 653761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 653861847f8eSopenharmony_ci * @since 8 653961847f8eSopenharmony_ci */ 654061847f8eSopenharmony_ci /** 654161847f8eSopenharmony_ci * key for video width, value type is number. 654261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 654361847f8eSopenharmony_ci * @atomicservice 654461847f8eSopenharmony_ci * @since 11 654561847f8eSopenharmony_ci */ 654661847f8eSopenharmony_ci /** 654761847f8eSopenharmony_ci * key for video width, value type is number. 654861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 654961847f8eSopenharmony_ci * @crossplatform 655061847f8eSopenharmony_ci * @atomicservice 655161847f8eSopenharmony_ci * @since 12 655261847f8eSopenharmony_ci */ 655361847f8eSopenharmony_ci MD_KEY_WIDTH = 'width', 655461847f8eSopenharmony_ci 655561847f8eSopenharmony_ci /** 655661847f8eSopenharmony_ci * key for video height, value type is number. 655761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 655861847f8eSopenharmony_ci * @since 8 655961847f8eSopenharmony_ci */ 656061847f8eSopenharmony_ci /** 656161847f8eSopenharmony_ci * key for video height, value type is number. 656261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 656361847f8eSopenharmony_ci * @atomicservice 656461847f8eSopenharmony_ci * @since 11 656561847f8eSopenharmony_ci */ 656661847f8eSopenharmony_ci /** 656761847f8eSopenharmony_ci * key for video height, value type is number. 656861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 656961847f8eSopenharmony_ci * @crossplatform 657061847f8eSopenharmony_ci * @atomicservice 657161847f8eSopenharmony_ci * @since 12 657261847f8eSopenharmony_ci */ 657361847f8eSopenharmony_ci MD_KEY_HEIGHT = 'height', 657461847f8eSopenharmony_ci 657561847f8eSopenharmony_ci /** 657661847f8eSopenharmony_ci * key for video frame rate, value type is number. 657761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 657861847f8eSopenharmony_ci * @since 8 657961847f8eSopenharmony_ci */ 658061847f8eSopenharmony_ci /** 658161847f8eSopenharmony_ci * key for video frame rate, value type is number. 658261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 658361847f8eSopenharmony_ci * @atomicservice 658461847f8eSopenharmony_ci * @since 11 658561847f8eSopenharmony_ci */ 658661847f8eSopenharmony_ci /** 658761847f8eSopenharmony_ci * key for video frame rate, value type is number. 658861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 658961847f8eSopenharmony_ci * @crossplatform 659061847f8eSopenharmony_ci * @atomicservice 659161847f8eSopenharmony_ci * @since 12 659261847f8eSopenharmony_ci */ 659361847f8eSopenharmony_ci MD_KEY_FRAME_RATE = 'frame_rate', 659461847f8eSopenharmony_ci 659561847f8eSopenharmony_ci /** 659661847f8eSopenharmony_ci * key for audio channel count, value type is number 659761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 659861847f8eSopenharmony_ci * @since 8 659961847f8eSopenharmony_ci */ 660061847f8eSopenharmony_ci /** 660161847f8eSopenharmony_ci * key for audio channel count, value type is number 660261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 660361847f8eSopenharmony_ci * @atomicservice 660461847f8eSopenharmony_ci * @since 11 660561847f8eSopenharmony_ci */ 660661847f8eSopenharmony_ci /** 660761847f8eSopenharmony_ci * key for audio channel count, value type is number 660861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 660961847f8eSopenharmony_ci * @crossplatform 661061847f8eSopenharmony_ci * @atomicservice 661161847f8eSopenharmony_ci * @since 12 661261847f8eSopenharmony_ci */ 661361847f8eSopenharmony_ci MD_KEY_AUD_CHANNEL_COUNT = 'channel_count', 661461847f8eSopenharmony_ci 661561847f8eSopenharmony_ci /** 661661847f8eSopenharmony_ci * key for audio sample rate, value type is number 661761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 661861847f8eSopenharmony_ci * @since 8 661961847f8eSopenharmony_ci */ 662061847f8eSopenharmony_ci /** 662161847f8eSopenharmony_ci * key for audio sample rate, value type is number 662261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 662361847f8eSopenharmony_ci * @atomicservice 662461847f8eSopenharmony_ci * @since 11 662561847f8eSopenharmony_ci */ 662661847f8eSopenharmony_ci /** 662761847f8eSopenharmony_ci * key for audio sample rate, value type is number 662861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 662961847f8eSopenharmony_ci * @crossplatform 663061847f8eSopenharmony_ci * @atomicservice 663161847f8eSopenharmony_ci * @since 12 663261847f8eSopenharmony_ci */ 663361847f8eSopenharmony_ci MD_KEY_AUD_SAMPLE_RATE = 'sample_rate', 663461847f8eSopenharmony_ci 663561847f8eSopenharmony_ci /** 663661847f8eSopenharmony_ci * key for audio bit depth, value type is number 663761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 663861847f8eSopenharmony_ci * @atomicservice 663961847f8eSopenharmony_ci * @since 12 664061847f8eSopenharmony_ci */ 664161847f8eSopenharmony_ci MD_KEY_AUD_SAMPLE_DEPTH = 'sample_depth', 664261847f8eSopenharmony_ci 664361847f8eSopenharmony_ci /** 664461847f8eSopenharmony_ci * Key for language. 664561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 664661847f8eSopenharmony_ci * @atomicservice 664761847f8eSopenharmony_ci * @since 12 664861847f8eSopenharmony_ci */ 664961847f8eSopenharmony_ci MD_KEY_LANGUAGE = 'language', 665061847f8eSopenharmony_ci 665161847f8eSopenharmony_ci /** 665261847f8eSopenharmony_ci * Key for track name, value is string. 665361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 665461847f8eSopenharmony_ci * @atomicservice 665561847f8eSopenharmony_ci * @since 12 665661847f8eSopenharmony_ci */ 665761847f8eSopenharmony_ci MD_KEY_TRACK_NAME = 'track_name', 665861847f8eSopenharmony_ci 665961847f8eSopenharmony_ci /** 666061847f8eSopenharmony_ci * Key for video hdr type, value type is number. 666161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 666261847f8eSopenharmony_ci * @atomicservice 666361847f8eSopenharmony_ci * @since 12 666461847f8eSopenharmony_ci */ 666561847f8eSopenharmony_ci MD_KEY_HDR_TYPE = 'hdr_type', 666661847f8eSopenharmony_ci } 666761847f8eSopenharmony_ci 666861847f8eSopenharmony_ci /** 666961847f8eSopenharmony_ci * Provides the video recorder profile definitions. 667061847f8eSopenharmony_ci * 667161847f8eSopenharmony_ci * @typedef VideoRecorderProfile 667261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 667361847f8eSopenharmony_ci * @systemapi 667461847f8eSopenharmony_ci * @since 9 667561847f8eSopenharmony_ci */ 667661847f8eSopenharmony_ci interface VideoRecorderProfile { 667761847f8eSopenharmony_ci /** 667861847f8eSopenharmony_ci * Indicates the audio bit rate. 667961847f8eSopenharmony_ci * @type { number } 668061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 668161847f8eSopenharmony_ci * @systemapi 668261847f8eSopenharmony_ci * @since 9 668361847f8eSopenharmony_ci */ 668461847f8eSopenharmony_ci readonly audioBitrate: number; 668561847f8eSopenharmony_ci 668661847f8eSopenharmony_ci /** 668761847f8eSopenharmony_ci * Indicates the number of audio channels. 668861847f8eSopenharmony_ci * @type { number } 668961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 669061847f8eSopenharmony_ci * @systemapi 669161847f8eSopenharmony_ci * @since 9 669261847f8eSopenharmony_ci */ 669361847f8eSopenharmony_ci readonly audioChannels: number; 669461847f8eSopenharmony_ci 669561847f8eSopenharmony_ci /** 669661847f8eSopenharmony_ci * Indicates the audio encoding format. 669761847f8eSopenharmony_ci * @type { CodecMimeType } 669861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 669961847f8eSopenharmony_ci * @systemapi 670061847f8eSopenharmony_ci * @since 9 670161847f8eSopenharmony_ci */ 670261847f8eSopenharmony_ci readonly audioCodec: CodecMimeType; 670361847f8eSopenharmony_ci 670461847f8eSopenharmony_ci /** 670561847f8eSopenharmony_ci * Indicates the audio sampling rate. 670661847f8eSopenharmony_ci * @type { number } 670761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 670861847f8eSopenharmony_ci * @systemapi 670961847f8eSopenharmony_ci * @since 9 671061847f8eSopenharmony_ci */ 671161847f8eSopenharmony_ci readonly audioSampleRate: number; 671261847f8eSopenharmony_ci 671361847f8eSopenharmony_ci /** 671461847f8eSopenharmony_ci * Indicates the output file format. 671561847f8eSopenharmony_ci * @type { ContainerFormatType } 671661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 671761847f8eSopenharmony_ci * @systemapi 671861847f8eSopenharmony_ci * @since 9 671961847f8eSopenharmony_ci */ 672061847f8eSopenharmony_ci readonly fileFormat: ContainerFormatType; 672161847f8eSopenharmony_ci 672261847f8eSopenharmony_ci /** 672361847f8eSopenharmony_ci * Indicates the video bit rate. 672461847f8eSopenharmony_ci * @type { number } 672561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 672661847f8eSopenharmony_ci * @systemapi 672761847f8eSopenharmony_ci * @since 9 672861847f8eSopenharmony_ci */ 672961847f8eSopenharmony_ci readonly videoBitrate: number; 673061847f8eSopenharmony_ci 673161847f8eSopenharmony_ci /** 673261847f8eSopenharmony_ci * Indicates the video encoding format. 673361847f8eSopenharmony_ci * @type { CodecMimeType } 673461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 673561847f8eSopenharmony_ci * @systemapi 673661847f8eSopenharmony_ci * @since 9 673761847f8eSopenharmony_ci */ 673861847f8eSopenharmony_ci readonly videoCodec: CodecMimeType; 673961847f8eSopenharmony_ci 674061847f8eSopenharmony_ci /** 674161847f8eSopenharmony_ci * Indicates the video width. 674261847f8eSopenharmony_ci * @type { number } 674361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 674461847f8eSopenharmony_ci * @systemapi 674561847f8eSopenharmony_ci * @since 9 674661847f8eSopenharmony_ci */ 674761847f8eSopenharmony_ci readonly videoFrameWidth: number; 674861847f8eSopenharmony_ci 674961847f8eSopenharmony_ci /** 675061847f8eSopenharmony_ci * Indicates the video height. 675161847f8eSopenharmony_ci * @type { number } 675261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 675361847f8eSopenharmony_ci * @systemapi 675461847f8eSopenharmony_ci * @since 9 675561847f8eSopenharmony_ci */ 675661847f8eSopenharmony_ci readonly videoFrameHeight: number; 675761847f8eSopenharmony_ci 675861847f8eSopenharmony_ci /** 675961847f8eSopenharmony_ci * Indicates the video frame rate. 676061847f8eSopenharmony_ci * @type { number } 676161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 676261847f8eSopenharmony_ci * @systemapi 676361847f8eSopenharmony_ci * @since 9 676461847f8eSopenharmony_ci */ 676561847f8eSopenharmony_ci readonly videoFrameRate: number; 676661847f8eSopenharmony_ci } 676761847f8eSopenharmony_ci 676861847f8eSopenharmony_ci /** 676961847f8eSopenharmony_ci * Enumerates audio source type for recorder. 677061847f8eSopenharmony_ci * 677161847f8eSopenharmony_ci * @enum { number } 677261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 677361847f8eSopenharmony_ci * @since 9 677461847f8eSopenharmony_ci */ 677561847f8eSopenharmony_ci /** 677661847f8eSopenharmony_ci * Enumerates audio source type for recorder. 677761847f8eSopenharmony_ci * 677861847f8eSopenharmony_ci * @enum { number } 677961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 678061847f8eSopenharmony_ci * @crossplatform 678161847f8eSopenharmony_ci * @atomicservice 678261847f8eSopenharmony_ci * @since 12 678361847f8eSopenharmony_ci */ 678461847f8eSopenharmony_ci enum AudioSourceType { 678561847f8eSopenharmony_ci /** 678661847f8eSopenharmony_ci * Default audio source type. 678761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 678861847f8eSopenharmony_ci * @since 9 678961847f8eSopenharmony_ci */ 679061847f8eSopenharmony_ci /** 679161847f8eSopenharmony_ci * Default audio source type. 679261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 679361847f8eSopenharmony_ci * @crossplatform 679461847f8eSopenharmony_ci * @since 12 679561847f8eSopenharmony_ci */ 679661847f8eSopenharmony_ci AUDIO_SOURCE_TYPE_DEFAULT = 0, 679761847f8eSopenharmony_ci /** 679861847f8eSopenharmony_ci * Source type mic. 679961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 680061847f8eSopenharmony_ci * @since 9 680161847f8eSopenharmony_ci */ 680261847f8eSopenharmony_ci /** 680361847f8eSopenharmony_ci * Source type mic. 680461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 680561847f8eSopenharmony_ci * @crossplatform 680661847f8eSopenharmony_ci * @atomicservice 680761847f8eSopenharmony_ci * @since 12 680861847f8eSopenharmony_ci */ 680961847f8eSopenharmony_ci AUDIO_SOURCE_TYPE_MIC = 1, 681061847f8eSopenharmony_ci /** 681161847f8eSopenharmony_ci * Source type Voice recognition. 681261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 681361847f8eSopenharmony_ci * @since 12 681461847f8eSopenharmony_ci */ 681561847f8eSopenharmony_ci AUDIO_SOURCE_TYPE_VOICE_RECOGNITION = 2, 681661847f8eSopenharmony_ci 681761847f8eSopenharmony_ci /** 681861847f8eSopenharmony_ci * Source type Voice communication. 681961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 682061847f8eSopenharmony_ci * @since 12 682161847f8eSopenharmony_ci */ 682261847f8eSopenharmony_ci AUDIO_SOURCE_TYPE_VOICE_COMMUNICATION = 7, 682361847f8eSopenharmony_ci /** 682461847f8eSopenharmony_ci * Source type Voice message. 682561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 682661847f8eSopenharmony_ci * @since 12 682761847f8eSopenharmony_ci */ 682861847f8eSopenharmony_ci AUDIO_SOURCE_TYPE_VOICE_MESSAGE = 10, 682961847f8eSopenharmony_ci /** 683061847f8eSopenharmony_ci * Source type Camcorder. 683161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 683261847f8eSopenharmony_ci * @since 12 683361847f8eSopenharmony_ci */ 683461847f8eSopenharmony_ci AUDIO_SOURCE_TYPE_CAMCORDER = 13, 683561847f8eSopenharmony_ci } 683661847f8eSopenharmony_ci 683761847f8eSopenharmony_ci /** 683861847f8eSopenharmony_ci * Enumerates video source type for recorder. 683961847f8eSopenharmony_ci * 684061847f8eSopenharmony_ci * @enum { number } 684161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 684261847f8eSopenharmony_ci * @since 9 684361847f8eSopenharmony_ci */ 684461847f8eSopenharmony_ci /** 684561847f8eSopenharmony_ci * Enumerates video source type for recorder. 684661847f8eSopenharmony_ci * 684761847f8eSopenharmony_ci * @enum { number } 684861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 684961847f8eSopenharmony_ci * @crossplatform 685061847f8eSopenharmony_ci * @since 12 685161847f8eSopenharmony_ci */ 685261847f8eSopenharmony_ci enum VideoSourceType { 685361847f8eSopenharmony_ci /** 685461847f8eSopenharmony_ci * Surface raw data. 685561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 685661847f8eSopenharmony_ci * @since 9 685761847f8eSopenharmony_ci */ 685861847f8eSopenharmony_ci /** 685961847f8eSopenharmony_ci * Surface raw data. 686061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 686161847f8eSopenharmony_ci * @crossplatform 686261847f8eSopenharmony_ci * @since 12 686361847f8eSopenharmony_ci */ 686461847f8eSopenharmony_ci VIDEO_SOURCE_TYPE_SURFACE_YUV = 0, 686561847f8eSopenharmony_ci /** 686661847f8eSopenharmony_ci * Surface ES data. 686761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 686861847f8eSopenharmony_ci * @since 9 686961847f8eSopenharmony_ci */ 687061847f8eSopenharmony_ci /** 687161847f8eSopenharmony_ci * Surface ES data. 687261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 687361847f8eSopenharmony_ci * @crossplatform 687461847f8eSopenharmony_ci * @since 12 687561847f8eSopenharmony_ci */ 687661847f8eSopenharmony_ci VIDEO_SOURCE_TYPE_SURFACE_ES = 1, 687761847f8eSopenharmony_ci } 687861847f8eSopenharmony_ci 687961847f8eSopenharmony_ci /** 688061847f8eSopenharmony_ci * Enumerates meta source type for recorder. 688161847f8eSopenharmony_ci * 688261847f8eSopenharmony_ci * @enum { number } 688361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 688461847f8eSopenharmony_ci * @systemapi 688561847f8eSopenharmony_ci * @since 12 688661847f8eSopenharmony_ci */ 688761847f8eSopenharmony_ci enum MetaSourceType { 688861847f8eSopenharmony_ci /** 688961847f8eSopenharmony_ci * Maker info for video. 689061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 689161847f8eSopenharmony_ci * @systemapi 689261847f8eSopenharmony_ci * @since 12 689361847f8eSopenharmony_ci */ 689461847f8eSopenharmony_ci VIDEO_MAKER_INFO = 0, 689561847f8eSopenharmony_ci } 689661847f8eSopenharmony_ci 689761847f8eSopenharmony_ci /** 689861847f8eSopenharmony_ci * Enumerates mode of creating recorder file 689961847f8eSopenharmony_ci * 690061847f8eSopenharmony_ci * @enum { number } 690161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 690261847f8eSopenharmony_ci * @since 12 690361847f8eSopenharmony_ci */ 690461847f8eSopenharmony_ci enum FileGenerationMode { 690561847f8eSopenharmony_ci /** 690661847f8eSopenharmony_ci * file created by app 690761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 690861847f8eSopenharmony_ci * @since 12 690961847f8eSopenharmony_ci */ 691061847f8eSopenharmony_ci APP_CREATE = 0, 691161847f8eSopenharmony_ci /** 691261847f8eSopenharmony_ci * file created by system, valid only in camera scene. 691361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 691461847f8eSopenharmony_ci * @since 12 691561847f8eSopenharmony_ci */ 691661847f8eSopenharmony_ci AUTO_CREATE_CAMERA_SCENE = 1, 691761847f8eSopenharmony_ci } 691861847f8eSopenharmony_ci /** 691961847f8eSopenharmony_ci * Provides the video recorder configuration definitions. 692061847f8eSopenharmony_ci * 692161847f8eSopenharmony_ci * @typedef VideoRecorderConfig 692261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 692361847f8eSopenharmony_ci * @systemapi 692461847f8eSopenharmony_ci * @since 9 692561847f8eSopenharmony_ci */ 692661847f8eSopenharmony_ci interface VideoRecorderConfig { 692761847f8eSopenharmony_ci /** 692861847f8eSopenharmony_ci * audio source type, details see @AudioSourceType . 692961847f8eSopenharmony_ci * @type { ?AudioSourceType } 693061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 693161847f8eSopenharmony_ci * @systemapi 693261847f8eSopenharmony_ci * @since 9 693361847f8eSopenharmony_ci */ 693461847f8eSopenharmony_ci audioSourceType?: AudioSourceType; 693561847f8eSopenharmony_ci /** 693661847f8eSopenharmony_ci * video source type, details see @VideoSourceType . 693761847f8eSopenharmony_ci * @type { VideoSourceType } 693861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 693961847f8eSopenharmony_ci * @systemapi 694061847f8eSopenharmony_ci * @since 9 694161847f8eSopenharmony_ci */ 694261847f8eSopenharmony_ci videoSourceType: VideoSourceType; 694361847f8eSopenharmony_ci /** 694461847f8eSopenharmony_ci * video recorder profile, can get by "getVideoRecorderProfile", details see @VideoRecorderProfile .= 694561847f8eSopenharmony_ci * @type { VideoRecorderProfile } 694661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 694761847f8eSopenharmony_ci * @systemapi 694861847f8eSopenharmony_ci * @since 9 694961847f8eSopenharmony_ci */ 695061847f8eSopenharmony_ci profile: VideoRecorderProfile; 695161847f8eSopenharmony_ci /** 695261847f8eSopenharmony_ci * video output uri.support two kind of uri now. 695361847f8eSopenharmony_ci * format like: scheme + "://" + "context". 695461847f8eSopenharmony_ci * fd: fd://fd 695561847f8eSopenharmony_ci * @type { string } 695661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 695761847f8eSopenharmony_ci * @systemapi 695861847f8eSopenharmony_ci * @since 9 695961847f8eSopenharmony_ci */ 696061847f8eSopenharmony_ci url: string; 696161847f8eSopenharmony_ci /** 696261847f8eSopenharmony_ci * Sets the video rotation angle in output file, and for the file to playback. mp4 support. 696361847f8eSopenharmony_ci * the range of rotation angle should be {0, 90, 180, 270}, default is 0. 696461847f8eSopenharmony_ci * @type { ?number } 696561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 696661847f8eSopenharmony_ci * @systemapi 696761847f8eSopenharmony_ci * @since 9 696861847f8eSopenharmony_ci */ 696961847f8eSopenharmony_ci rotation?: number; 697061847f8eSopenharmony_ci /** 697161847f8eSopenharmony_ci * geographical location information. 697261847f8eSopenharmony_ci * @type { ?Location } 697361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.VideoRecorder 697461847f8eSopenharmony_ci * @systemapi 697561847f8eSopenharmony_ci * @since 9 697661847f8eSopenharmony_ci */ 697761847f8eSopenharmony_ci location?: Location; 697861847f8eSopenharmony_ci } 697961847f8eSopenharmony_ci 698061847f8eSopenharmony_ci /** 698161847f8eSopenharmony_ci * Provides encoder info. 698261847f8eSopenharmony_ci * 698361847f8eSopenharmony_ci * @typedef EncoderInfo 698461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 698561847f8eSopenharmony_ci * @since 11 698661847f8eSopenharmony_ci */ 698761847f8eSopenharmony_ci interface EncoderInfo { 698861847f8eSopenharmony_ci /** 698961847f8eSopenharmony_ci * encoder format MIME 699061847f8eSopenharmony_ci * @type { CodecMimeType } 699161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 699261847f8eSopenharmony_ci * @since 11 699361847f8eSopenharmony_ci */ 699461847f8eSopenharmony_ci mimeType: CodecMimeType; 699561847f8eSopenharmony_ci 699661847f8eSopenharmony_ci /** 699761847f8eSopenharmony_ci * encoder type, audio or video 699861847f8eSopenharmony_ci * @type { string } 699961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 700061847f8eSopenharmony_ci * @since 11 700161847f8eSopenharmony_ci */ 700261847f8eSopenharmony_ci type: string; 700361847f8eSopenharmony_ci 700461847f8eSopenharmony_ci /** 700561847f8eSopenharmony_ci * audio or video encoder bitRate range 700661847f8eSopenharmony_ci * @type { ?Range } 700761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 700861847f8eSopenharmony_ci * @since 11 700961847f8eSopenharmony_ci */ 701061847f8eSopenharmony_ci bitRate?: Range; 701161847f8eSopenharmony_ci 701261847f8eSopenharmony_ci /** 701361847f8eSopenharmony_ci * video encoder frame rate range 701461847f8eSopenharmony_ci * @type { ?Range } 701561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 701661847f8eSopenharmony_ci * @since 11 701761847f8eSopenharmony_ci */ 701861847f8eSopenharmony_ci frameRate?: Range; 701961847f8eSopenharmony_ci 702061847f8eSopenharmony_ci /** 702161847f8eSopenharmony_ci * video encoder width range 702261847f8eSopenharmony_ci * @type { ?Range } 702361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 702461847f8eSopenharmony_ci * @since 11 702561847f8eSopenharmony_ci */ 702661847f8eSopenharmony_ci width?: Range; 702761847f8eSopenharmony_ci 702861847f8eSopenharmony_ci /** 702961847f8eSopenharmony_ci * video encoder height range 703061847f8eSopenharmony_ci * @type { ?Range } 703161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 703261847f8eSopenharmony_ci * @since 11 703361847f8eSopenharmony_ci */ 703461847f8eSopenharmony_ci height?: Range; 703561847f8eSopenharmony_ci 703661847f8eSopenharmony_ci /** 703761847f8eSopenharmony_ci * audio encoder channel range 703861847f8eSopenharmony_ci * @type { ?Range } 703961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 704061847f8eSopenharmony_ci * @since 11 704161847f8eSopenharmony_ci */ 704261847f8eSopenharmony_ci channels?: Range; 704361847f8eSopenharmony_ci 704461847f8eSopenharmony_ci /** 704561847f8eSopenharmony_ci * audio encoder sample rate collection 704661847f8eSopenharmony_ci * @type { ?Array<number> } 704761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 704861847f8eSopenharmony_ci * @since 11 704961847f8eSopenharmony_ci */ 705061847f8eSopenharmony_ci sampleRate?: Array<number>; 705161847f8eSopenharmony_ci } 705261847f8eSopenharmony_ci 705361847f8eSopenharmony_ci /** 705461847f8eSopenharmony_ci * Provides Range with lower and upper limit. 705561847f8eSopenharmony_ci * 705661847f8eSopenharmony_ci * @typedef Range 705761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 705861847f8eSopenharmony_ci * @since 11 705961847f8eSopenharmony_ci */ 706061847f8eSopenharmony_ci interface Range { 706161847f8eSopenharmony_ci /** 706261847f8eSopenharmony_ci * lower limit of the range 706361847f8eSopenharmony_ci * @type { number } 706461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 706561847f8eSopenharmony_ci * @since 11 706661847f8eSopenharmony_ci */ 706761847f8eSopenharmony_ci min: number; 706861847f8eSopenharmony_ci 706961847f8eSopenharmony_ci /** 707061847f8eSopenharmony_ci * upper limit of the range 707161847f8eSopenharmony_ci * @type { number } 707261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 707361847f8eSopenharmony_ci * @since 11 707461847f8eSopenharmony_ci */ 707561847f8eSopenharmony_ci max: number; 707661847f8eSopenharmony_ci } 707761847f8eSopenharmony_ci 707861847f8eSopenharmony_ci /** 707961847f8eSopenharmony_ci * Provides the media recorder profile definitions. 708061847f8eSopenharmony_ci * 708161847f8eSopenharmony_ci * @typedef AVRecorderProfile 708261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 708361847f8eSopenharmony_ci * @since 9 708461847f8eSopenharmony_ci */ 708561847f8eSopenharmony_ci /** 708661847f8eSopenharmony_ci * Provides the media recorder profile definitions. 708761847f8eSopenharmony_ci * 708861847f8eSopenharmony_ci * @typedef AVRecorderProfile 708961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 709061847f8eSopenharmony_ci * @crossplatform 709161847f8eSopenharmony_ci * @atomicservice 709261847f8eSopenharmony_ci * @since 12 709361847f8eSopenharmony_ci */ 709461847f8eSopenharmony_ci interface AVRecorderProfile { 709561847f8eSopenharmony_ci /** 709661847f8eSopenharmony_ci * Indicates the audio bitrate. 709761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 709861847f8eSopenharmony_ci * @since 9 709961847f8eSopenharmony_ci */ 710061847f8eSopenharmony_ci /** 710161847f8eSopenharmony_ci * Indicates the audio bitrate. 710261847f8eSopenharmony_ci * @type { ?number } 710361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 710461847f8eSopenharmony_ci * @crossplatform 710561847f8eSopenharmony_ci * @atomicservice 710661847f8eSopenharmony_ci * @since 12 710761847f8eSopenharmony_ci */ 710861847f8eSopenharmony_ci audioBitrate?: number; 710961847f8eSopenharmony_ci 711061847f8eSopenharmony_ci /** 711161847f8eSopenharmony_ci * Indicates the number of audio channels. 711261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 711361847f8eSopenharmony_ci * @since 9 711461847f8eSopenharmony_ci */ 711561847f8eSopenharmony_ci /** 711661847f8eSopenharmony_ci * Indicates the number of audio channels. 711761847f8eSopenharmony_ci * @type { ?number } 711861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 711961847f8eSopenharmony_ci * @crossplatform 712061847f8eSopenharmony_ci * @atomicservice 712161847f8eSopenharmony_ci * @since 12 712261847f8eSopenharmony_ci */ 712361847f8eSopenharmony_ci audioChannels?: number; 712461847f8eSopenharmony_ci 712561847f8eSopenharmony_ci /** 712661847f8eSopenharmony_ci * Indicates the audio encoding format. 712761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 712861847f8eSopenharmony_ci * @since 9 712961847f8eSopenharmony_ci */ 713061847f8eSopenharmony_ci /** 713161847f8eSopenharmony_ci * Indicates the audio encoding format. 713261847f8eSopenharmony_ci * @type { ?CodecMimeType } 713361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 713461847f8eSopenharmony_ci * @crossplatform 713561847f8eSopenharmony_ci * @atomicservice 713661847f8eSopenharmony_ci * @since 12 713761847f8eSopenharmony_ci */ 713861847f8eSopenharmony_ci audioCodec?: CodecMimeType; 713961847f8eSopenharmony_ci 714061847f8eSopenharmony_ci /** 714161847f8eSopenharmony_ci * Indicates the audio sampling rate. 714261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 714361847f8eSopenharmony_ci * @since 9 714461847f8eSopenharmony_ci */ 714561847f8eSopenharmony_ci /** 714661847f8eSopenharmony_ci * Indicates the audio sampling rate. 714761847f8eSopenharmony_ci * @type { ?number } 714861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 714961847f8eSopenharmony_ci * @crossplatform 715061847f8eSopenharmony_ci * @atomicservice 715161847f8eSopenharmony_ci * @since 12 715261847f8eSopenharmony_ci */ 715361847f8eSopenharmony_ci audioSampleRate?: number; 715461847f8eSopenharmony_ci 715561847f8eSopenharmony_ci /** 715661847f8eSopenharmony_ci * Indicates the output file format. 715761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 715861847f8eSopenharmony_ci * @since 9 715961847f8eSopenharmony_ci */ 716061847f8eSopenharmony_ci /** 716161847f8eSopenharmony_ci * Indicates the output file format. 716261847f8eSopenharmony_ci * @type { ContainerFormatType } 716361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 716461847f8eSopenharmony_ci * @crossplatform 716561847f8eSopenharmony_ci * @atomicservice 716661847f8eSopenharmony_ci * @since 12 716761847f8eSopenharmony_ci */ 716861847f8eSopenharmony_ci fileFormat: ContainerFormatType; 716961847f8eSopenharmony_ci 717061847f8eSopenharmony_ci /** 717161847f8eSopenharmony_ci * Indicates the video bitrate. 717261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 717361847f8eSopenharmony_ci * @since 9 717461847f8eSopenharmony_ci */ 717561847f8eSopenharmony_ci /** 717661847f8eSopenharmony_ci * Indicates the video bitrate. 717761847f8eSopenharmony_ci * @type { ?number } 717861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 717961847f8eSopenharmony_ci * @crossplatform 718061847f8eSopenharmony_ci * @since 12 718161847f8eSopenharmony_ci */ 718261847f8eSopenharmony_ci videoBitrate?: number; 718361847f8eSopenharmony_ci 718461847f8eSopenharmony_ci /** 718561847f8eSopenharmony_ci * Indicates the video encoding format. 718661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 718761847f8eSopenharmony_ci * @since 9 718861847f8eSopenharmony_ci */ 718961847f8eSopenharmony_ci /** 719061847f8eSopenharmony_ci * Indicates the video encoding format. 719161847f8eSopenharmony_ci * @type { ?CodecMimeType } 719261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 719361847f8eSopenharmony_ci * @crossplatform 719461847f8eSopenharmony_ci * @since 12 719561847f8eSopenharmony_ci */ 719661847f8eSopenharmony_ci videoCodec?: CodecMimeType; 719761847f8eSopenharmony_ci 719861847f8eSopenharmony_ci /** 719961847f8eSopenharmony_ci * Indicates the video width. 720061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 720161847f8eSopenharmony_ci * @since 9 720261847f8eSopenharmony_ci */ 720361847f8eSopenharmony_ci /** 720461847f8eSopenharmony_ci * Indicates the video width. 720561847f8eSopenharmony_ci * @type { ?number } 720661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 720761847f8eSopenharmony_ci * @crossplatform 720861847f8eSopenharmony_ci * @since 12 720961847f8eSopenharmony_ci */ 721061847f8eSopenharmony_ci videoFrameWidth?: number; 721161847f8eSopenharmony_ci 721261847f8eSopenharmony_ci /** 721361847f8eSopenharmony_ci * Indicates the video height. 721461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 721561847f8eSopenharmony_ci * @since 9 721661847f8eSopenharmony_ci */ 721761847f8eSopenharmony_ci /** 721861847f8eSopenharmony_ci * Indicates the video height. 721961847f8eSopenharmony_ci * @type { ?number } 722061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 722161847f8eSopenharmony_ci * @crossplatform 722261847f8eSopenharmony_ci * @since 12 722361847f8eSopenharmony_ci */ 722461847f8eSopenharmony_ci videoFrameHeight?: number; 722561847f8eSopenharmony_ci 722661847f8eSopenharmony_ci /** 722761847f8eSopenharmony_ci * Indicates the video frame rate. 722861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 722961847f8eSopenharmony_ci * @since 9 723061847f8eSopenharmony_ci */ 723161847f8eSopenharmony_ci /** 723261847f8eSopenharmony_ci * Indicates the video frame rate. 723361847f8eSopenharmony_ci * @type { ?number } 723461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 723561847f8eSopenharmony_ci * @crossplatform 723661847f8eSopenharmony_ci * @since 12 723761847f8eSopenharmony_ci */ 723861847f8eSopenharmony_ci videoFrameRate?: number; 723961847f8eSopenharmony_ci 724061847f8eSopenharmony_ci /** 724161847f8eSopenharmony_ci * Whether to record HDR video. 724261847f8eSopenharmony_ci * @type { ?boolean } 724361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 724461847f8eSopenharmony_ci * @since 11 724561847f8eSopenharmony_ci */ 724661847f8eSopenharmony_ci /** 724761847f8eSopenharmony_ci * Whether to record HDR video. 724861847f8eSopenharmony_ci * @type { ?boolean } 724961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 725061847f8eSopenharmony_ci * @crossplatform 725161847f8eSopenharmony_ci * @since 12 725261847f8eSopenharmony_ci */ 725361847f8eSopenharmony_ci isHdr?: boolean; 725461847f8eSopenharmony_ci 725561847f8eSopenharmony_ci /** 725661847f8eSopenharmony_ci * Whether to encode the video in temporal scale mode. 725761847f8eSopenharmony_ci * @type { ?boolean } 725861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 725961847f8eSopenharmony_ci * @crossplatform 726061847f8eSopenharmony_ci * @since 12 726161847f8eSopenharmony_ci */ 726261847f8eSopenharmony_ci enableTemporalScale?: boolean; 726361847f8eSopenharmony_ci } 726461847f8eSopenharmony_ci 726561847f8eSopenharmony_ci /** 726661847f8eSopenharmony_ci * Provides the media recorder configuration definitions. 726761847f8eSopenharmony_ci * 726861847f8eSopenharmony_ci * @typedef AVRecorderConfig 726961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 727061847f8eSopenharmony_ci * @since 9 727161847f8eSopenharmony_ci */ 727261847f8eSopenharmony_ci /** 727361847f8eSopenharmony_ci * Provides the media recorder configuration definitions. 727461847f8eSopenharmony_ci * 727561847f8eSopenharmony_ci * @typedef AVRecorderConfig 727661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 727761847f8eSopenharmony_ci * @crossplatform 727861847f8eSopenharmony_ci * @atomicservice 727961847f8eSopenharmony_ci * @since 12 728061847f8eSopenharmony_ci */ 728161847f8eSopenharmony_ci interface AVRecorderConfig { 728261847f8eSopenharmony_ci /** 728361847f8eSopenharmony_ci * Audio source type, details see @AudioSourceType . 728461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 728561847f8eSopenharmony_ci * @since 9 728661847f8eSopenharmony_ci */ 728761847f8eSopenharmony_ci /** 728861847f8eSopenharmony_ci * Audio source type, details see @AudioSourceType . 728961847f8eSopenharmony_ci * @type { ?AudioSourceType } 729061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 729161847f8eSopenharmony_ci * @crossplatform 729261847f8eSopenharmony_ci * @atomicservice 729361847f8eSopenharmony_ci * @since 12 729461847f8eSopenharmony_ci */ 729561847f8eSopenharmony_ci audioSourceType?: AudioSourceType; 729661847f8eSopenharmony_ci /** 729761847f8eSopenharmony_ci * Video source type, details see @VideoSourceType . 729861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 729961847f8eSopenharmony_ci * @since 9 730061847f8eSopenharmony_ci */ 730161847f8eSopenharmony_ci /** 730261847f8eSopenharmony_ci * Video source type, details see @VideoSourceType . 730361847f8eSopenharmony_ci * @type { ?VideoSourceType } 730461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 730561847f8eSopenharmony_ci * @crossplatform 730661847f8eSopenharmony_ci * @since 12 730761847f8eSopenharmony_ci */ 730861847f8eSopenharmony_ci videoSourceType?: VideoSourceType; 730961847f8eSopenharmony_ci /** 731061847f8eSopenharmony_ci * Meta source types, details see @MetaSourceType . 731161847f8eSopenharmony_ci * @type { ?Array<MetaSourceType> } 731261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 731361847f8eSopenharmony_ci * @systemapi 731461847f8eSopenharmony_ci * @since 12 731561847f8eSopenharmony_ci */ 731661847f8eSopenharmony_ci metaSourceTypes?: Array<MetaSourceType>; 731761847f8eSopenharmony_ci /** 731861847f8eSopenharmony_ci * Video recorder profile, details see @AVRecorderProfile . 731961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 732061847f8eSopenharmony_ci * @since 9 732161847f8eSopenharmony_ci */ 732261847f8eSopenharmony_ci /** 732361847f8eSopenharmony_ci * Video recorder profile, details see @AVRecorderProfile . 732461847f8eSopenharmony_ci * @type { AVRecorderProfile } 732561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 732661847f8eSopenharmony_ci * @crossplatform 732761847f8eSopenharmony_ci * @atomicservice 732861847f8eSopenharmony_ci * @since 12 732961847f8eSopenharmony_ci */ 733061847f8eSopenharmony_ci profile: AVRecorderProfile; 733161847f8eSopenharmony_ci /** 733261847f8eSopenharmony_ci * File output uri, support a kind of uri now. 733361847f8eSopenharmony_ci * format like: "fd://" + "context". 733461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 733561847f8eSopenharmony_ci * @since 9 733661847f8eSopenharmony_ci */ 733761847f8eSopenharmony_ci /** 733861847f8eSopenharmony_ci * File output uri, support a kind of uri now. 733961847f8eSopenharmony_ci * format like: "fd://" + "context". 734061847f8eSopenharmony_ci * @type { string } 734161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 734261847f8eSopenharmony_ci * @crossplatform 734361847f8eSopenharmony_ci * @atomicservice 734461847f8eSopenharmony_ci * @since 12 734561847f8eSopenharmony_ci */ 734661847f8eSopenharmony_ci url: string; 734761847f8eSopenharmony_ci 734861847f8eSopenharmony_ci /** 734961847f8eSopenharmony_ci * Mode of creating recorder file, details see @FileGenerationMode. 735061847f8eSopenharmony_ci * @type { ?FileGenerationMode } 735161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 735261847f8eSopenharmony_ci * @since 12 735361847f8eSopenharmony_ci */ 735461847f8eSopenharmony_ci fileGenerationMode?: FileGenerationMode; 735561847f8eSopenharmony_ci /** 735661847f8eSopenharmony_ci * Sets the video rotation angle in output file, and for the file to playback, mp4 support 735761847f8eSopenharmony_ci * the range of rotation angle should be {0, 90, 180, 270}, default is 0. 735861847f8eSopenharmony_ci * @type { ?number } 735961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 736061847f8eSopenharmony_ci * @since 9 736161847f8eSopenharmony_ci * @deprecated since 12 736261847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVMetadata#videoOrientation 736361847f8eSopenharmony_ci */ 736461847f8eSopenharmony_ci rotation?: number; 736561847f8eSopenharmony_ci /** 736661847f8eSopenharmony_ci * Geographical location information. 736761847f8eSopenharmony_ci * @type { ?Location } 736861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 736961847f8eSopenharmony_ci * @since 9 737061847f8eSopenharmony_ci * @deprecated since 12 737161847f8eSopenharmony_ci * @useinstead ohos.multimedia.media/media.AVMetadata#location 737261847f8eSopenharmony_ci */ 737361847f8eSopenharmony_ci location?: Location; 737461847f8eSopenharmony_ci /** 737561847f8eSopenharmony_ci * Set global metadata info. Details see @AVMetadata 737661847f8eSopenharmony_ci * @type { ?AVMetadata } 737761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVRecorder 737861847f8eSopenharmony_ci * @since 12 737961847f8eSopenharmony_ci */ 738061847f8eSopenharmony_ci metadata?: AVMetadata; 738161847f8eSopenharmony_ci } 738261847f8eSopenharmony_ci 738361847f8eSopenharmony_ci /** 738461847f8eSopenharmony_ci * Provides the container definition for media description key-value pairs. 738561847f8eSopenharmony_ci * 738661847f8eSopenharmony_ci * @typedef MediaDescription 738761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 738861847f8eSopenharmony_ci * @since 8 738961847f8eSopenharmony_ci */ 739061847f8eSopenharmony_ci /** 739161847f8eSopenharmony_ci * Provides the container definition for media description key-value pairs. 739261847f8eSopenharmony_ci * 739361847f8eSopenharmony_ci * @typedef MediaDescription 739461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 739561847f8eSopenharmony_ci * @atomicservice 739661847f8eSopenharmony_ci * @since 11 739761847f8eSopenharmony_ci */ 739861847f8eSopenharmony_ci /** 739961847f8eSopenharmony_ci * Provides the container definition for media description key-value pairs. 740061847f8eSopenharmony_ci * 740161847f8eSopenharmony_ci * @typedef MediaDescription 740261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 740361847f8eSopenharmony_ci * @crossplatform 740461847f8eSopenharmony_ci * @atomicservice 740561847f8eSopenharmony_ci * @since 12 740661847f8eSopenharmony_ci */ 740761847f8eSopenharmony_ci interface MediaDescription { 740861847f8eSopenharmony_ci /** 740961847f8eSopenharmony_ci * key:value pair, key see @MediaDescriptionKey . 741061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 741161847f8eSopenharmony_ci * @since 8 741261847f8eSopenharmony_ci */ 741361847f8eSopenharmony_ci /** 741461847f8eSopenharmony_ci * key:value pair, key see @MediaDescriptionKey . 741561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 741661847f8eSopenharmony_ci * @atomicservice 741761847f8eSopenharmony_ci * @since 11 741861847f8eSopenharmony_ci */ 741961847f8eSopenharmony_ci /** 742061847f8eSopenharmony_ci * key:value pair, key see @MediaDescriptionKey . 742161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 742261847f8eSopenharmony_ci * @crossplatform 742361847f8eSopenharmony_ci * @atomicservice 742461847f8eSopenharmony_ci * @since 12 742561847f8eSopenharmony_ci */ 742661847f8eSopenharmony_ci [key: string]: Object; 742761847f8eSopenharmony_ci } 742861847f8eSopenharmony_ci 742961847f8eSopenharmony_ci /** 743061847f8eSopenharmony_ci * Enumerates seek mode. 743161847f8eSopenharmony_ci * 743261847f8eSopenharmony_ci * @enum { number } 743361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 743461847f8eSopenharmony_ci * @since 8 743561847f8eSopenharmony_ci */ 743661847f8eSopenharmony_ci /** 743761847f8eSopenharmony_ci * Enumerates seek mode. 743861847f8eSopenharmony_ci * 743961847f8eSopenharmony_ci * @enum { number } 744061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 744161847f8eSopenharmony_ci * @atomicservice 744261847f8eSopenharmony_ci * @since 11 744361847f8eSopenharmony_ci */ 744461847f8eSopenharmony_ci /** 744561847f8eSopenharmony_ci * Enumerates seek mode. 744661847f8eSopenharmony_ci * 744761847f8eSopenharmony_ci * @enum { number } 744861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 744961847f8eSopenharmony_ci * @crossplatform 745061847f8eSopenharmony_ci * @atomicservice 745161847f8eSopenharmony_ci * @since 12 745261847f8eSopenharmony_ci */ 745361847f8eSopenharmony_ci enum SeekMode { 745461847f8eSopenharmony_ci /** 745561847f8eSopenharmony_ci * seek to the next sync frame of the given timestamp 745661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 745761847f8eSopenharmony_ci * @since 8 745861847f8eSopenharmony_ci */ 745961847f8eSopenharmony_ci /** 746061847f8eSopenharmony_ci * seek to the next sync frame of the given timestamp 746161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 746261847f8eSopenharmony_ci * @atomicservice 746361847f8eSopenharmony_ci * @since 11 746461847f8eSopenharmony_ci */ 746561847f8eSopenharmony_ci /** 746661847f8eSopenharmony_ci * seek to the next sync frame of the given timestamp 746761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 746861847f8eSopenharmony_ci * @crossplatform 746961847f8eSopenharmony_ci * @atomicservice 747061847f8eSopenharmony_ci * @since 12 747161847f8eSopenharmony_ci */ 747261847f8eSopenharmony_ci SEEK_NEXT_SYNC = 0, 747361847f8eSopenharmony_ci /** 747461847f8eSopenharmony_ci * seek to the previous sync frame of the given timestamp 747561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 747661847f8eSopenharmony_ci * @since 8 747761847f8eSopenharmony_ci */ 747861847f8eSopenharmony_ci /** 747961847f8eSopenharmony_ci * seek to the previous sync frame of the given timestamp 748061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 748161847f8eSopenharmony_ci * @atomicservice 748261847f8eSopenharmony_ci * @since 11 748361847f8eSopenharmony_ci */ 748461847f8eSopenharmony_ci /** 748561847f8eSopenharmony_ci * seek to the previous sync frame of the given timestamp 748661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 748761847f8eSopenharmony_ci * @crossplatform 748861847f8eSopenharmony_ci * @atomicservice 748961847f8eSopenharmony_ci * @since 12 749061847f8eSopenharmony_ci */ 749161847f8eSopenharmony_ci SEEK_PREV_SYNC = 1, 749261847f8eSopenharmony_ci /** 749361847f8eSopenharmony_ci * Seek to the closest frame of the given timestamp. 749461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 749561847f8eSopenharmony_ci * @atomicservice 749661847f8eSopenharmony_ci * @since 12 749761847f8eSopenharmony_ci */ 749861847f8eSopenharmony_ci SEEK_CLOSEST = 2, 749961847f8eSopenharmony_ci /** 750061847f8eSopenharmony_ci * Seek in continuous mode. 750161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 750261847f8eSopenharmony_ci * @systemapi 750361847f8eSopenharmony_ci * @since 13 750461847f8eSopenharmony_ci */ 750561847f8eSopenharmony_ci SEEK_CONTINUOUS = 3, 750661847f8eSopenharmony_ci } 750761847f8eSopenharmony_ci 750861847f8eSopenharmony_ci /** 750961847f8eSopenharmony_ci * Enumerates switch mode. 751061847f8eSopenharmony_ci * 751161847f8eSopenharmony_ci * @enum { number } 751261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 751361847f8eSopenharmony_ci * @crossplatform 751461847f8eSopenharmony_ci * @atomicservice 751561847f8eSopenharmony_ci * @since 12 751661847f8eSopenharmony_ci */ 751761847f8eSopenharmony_ci enum SwitchMode { 751861847f8eSopenharmony_ci /** 751961847f8eSopenharmony_ci * switch to the next sync frame of the given timestamp 752061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 752161847f8eSopenharmony_ci * @crossplatform 752261847f8eSopenharmony_ci * @atomicservice 752361847f8eSopenharmony_ci * @since 12 752461847f8eSopenharmony_ci */ 752561847f8eSopenharmony_ci SMOOTH = 0, 752661847f8eSopenharmony_ci /** 752761847f8eSopenharmony_ci * switch to the previous sync frame of the given timestamp 752861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 752961847f8eSopenharmony_ci * @crossplatform 753061847f8eSopenharmony_ci * @atomicservice 753161847f8eSopenharmony_ci * @since 12 753261847f8eSopenharmony_ci */ 753361847f8eSopenharmony_ci SEGMENT = 1, 753461847f8eSopenharmony_ci /** 753561847f8eSopenharmony_ci * switch to the closest frame of the given timestamp. 753661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 753761847f8eSopenharmony_ci * @atomicservice 753861847f8eSopenharmony_ci * @since 12 753961847f8eSopenharmony_ci */ 754061847f8eSopenharmony_ci CLOSEST = 2, 754161847f8eSopenharmony_ci } 754261847f8eSopenharmony_ci 754361847f8eSopenharmony_ci /** 754461847f8eSopenharmony_ci * Enumerates Codec MIME types. 754561847f8eSopenharmony_ci * 754661847f8eSopenharmony_ci * @enum { string } 754761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 754861847f8eSopenharmony_ci * @since 8 754961847f8eSopenharmony_ci */ 755061847f8eSopenharmony_ci /** 755161847f8eSopenharmony_ci * Enumerates Codec MIME types. 755261847f8eSopenharmony_ci * 755361847f8eSopenharmony_ci * @enum { string } 755461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 755561847f8eSopenharmony_ci * @crossplatform 755661847f8eSopenharmony_ci * @atomicservice 755761847f8eSopenharmony_ci * @since 12 755861847f8eSopenharmony_ci */ 755961847f8eSopenharmony_ci enum CodecMimeType { 756061847f8eSopenharmony_ci /** 756161847f8eSopenharmony_ci * H.263 codec MIME type. 756261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 756361847f8eSopenharmony_ci * @since 8 756461847f8eSopenharmony_ci */ 756561847f8eSopenharmony_ci /** 756661847f8eSopenharmony_ci * H.263 codec MIME type. 756761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 756861847f8eSopenharmony_ci * @crossplatform 756961847f8eSopenharmony_ci * @since 12 757061847f8eSopenharmony_ci */ 757161847f8eSopenharmony_ci VIDEO_H263 = 'video/h263', 757261847f8eSopenharmony_ci /** 757361847f8eSopenharmony_ci * H.264 codec MIME type. 757461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 757561847f8eSopenharmony_ci * @since 8 757661847f8eSopenharmony_ci */ 757761847f8eSopenharmony_ci /** 757861847f8eSopenharmony_ci * H.264 codec MIME type. 757961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 758061847f8eSopenharmony_ci * @crossplatform 758161847f8eSopenharmony_ci * @since 12 758261847f8eSopenharmony_ci */ 758361847f8eSopenharmony_ci VIDEO_AVC = 'video/avc', 758461847f8eSopenharmony_ci /** 758561847f8eSopenharmony_ci * MPEG2 codec MIME type. 758661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 758761847f8eSopenharmony_ci * @since 8 758861847f8eSopenharmony_ci */ 758961847f8eSopenharmony_ci /** 759061847f8eSopenharmony_ci * MPEG2 codec MIME type. 759161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 759261847f8eSopenharmony_ci * @crossplatform 759361847f8eSopenharmony_ci * @since 12 759461847f8eSopenharmony_ci */ 759561847f8eSopenharmony_ci VIDEO_MPEG2 = 'video/mpeg2', 759661847f8eSopenharmony_ci /** 759761847f8eSopenharmony_ci * MPEG4 codec MIME type 759861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 759961847f8eSopenharmony_ci * @since 8 760061847f8eSopenharmony_ci */ 760161847f8eSopenharmony_ci /** 760261847f8eSopenharmony_ci * MPEG4 codec MIME type 760361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 760461847f8eSopenharmony_ci * @crossplatform 760561847f8eSopenharmony_ci * @since 12 760661847f8eSopenharmony_ci */ 760761847f8eSopenharmony_ci VIDEO_MPEG4 = 'video/mp4v-es', 760861847f8eSopenharmony_ci 760961847f8eSopenharmony_ci /** 761061847f8eSopenharmony_ci * VP8 codec MIME type 761161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 761261847f8eSopenharmony_ci * @since 8 761361847f8eSopenharmony_ci */ 761461847f8eSopenharmony_ci /** 761561847f8eSopenharmony_ci * VP8 codec MIME type 761661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 761761847f8eSopenharmony_ci * @crossplatform 761861847f8eSopenharmony_ci * @since 12 761961847f8eSopenharmony_ci */ 762061847f8eSopenharmony_ci VIDEO_VP8 = 'video/x-vnd.on2.vp8', 762161847f8eSopenharmony_ci 762261847f8eSopenharmony_ci /** 762361847f8eSopenharmony_ci * AAC codec MIME type. 762461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 762561847f8eSopenharmony_ci * @since 8 762661847f8eSopenharmony_ci */ 762761847f8eSopenharmony_ci /** 762861847f8eSopenharmony_ci * AAC codec MIME type. 762961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 763061847f8eSopenharmony_ci * @crossplatform 763161847f8eSopenharmony_ci * @atomicservice 763261847f8eSopenharmony_ci * @since 12 763361847f8eSopenharmony_ci */ 763461847f8eSopenharmony_ci AUDIO_AAC = 'audio/mp4a-latm', 763561847f8eSopenharmony_ci 763661847f8eSopenharmony_ci /** 763761847f8eSopenharmony_ci * vorbis codec MIME type. 763861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 763961847f8eSopenharmony_ci * @since 8 764061847f8eSopenharmony_ci */ 764161847f8eSopenharmony_ci /** 764261847f8eSopenharmony_ci * vorbis codec MIME type. 764361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 764461847f8eSopenharmony_ci * @crossplatform 764561847f8eSopenharmony_ci * @since 12 764661847f8eSopenharmony_ci */ 764761847f8eSopenharmony_ci AUDIO_VORBIS = 'audio/vorbis', 764861847f8eSopenharmony_ci 764961847f8eSopenharmony_ci /** 765061847f8eSopenharmony_ci * flac codec MIME type. 765161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 765261847f8eSopenharmony_ci * @since 8 765361847f8eSopenharmony_ci */ 765461847f8eSopenharmony_ci /** 765561847f8eSopenharmony_ci * flac codec MIME type. 765661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 765761847f8eSopenharmony_ci * @crossplatform 765861847f8eSopenharmony_ci * @since 12 765961847f8eSopenharmony_ci */ 766061847f8eSopenharmony_ci AUDIO_FLAC = 'audio/flac', 766161847f8eSopenharmony_ci 766261847f8eSopenharmony_ci /** 766361847f8eSopenharmony_ci * H.265 codec MIME type. 766461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 766561847f8eSopenharmony_ci * @since 11 766661847f8eSopenharmony_ci */ 766761847f8eSopenharmony_ci /** 766861847f8eSopenharmony_ci * H.265 codec MIME type. 766961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 767061847f8eSopenharmony_ci * @crossplatform 767161847f8eSopenharmony_ci * @since 12 767261847f8eSopenharmony_ci */ 767361847f8eSopenharmony_ci VIDEO_HEVC = 'video/hevc', 767461847f8eSopenharmony_ci /** 767561847f8eSopenharmony_ci * mp3 codec MIME type. 767661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 767761847f8eSopenharmony_ci * @since 12 767861847f8eSopenharmony_ci */ 767961847f8eSopenharmony_ci AUDIO_MP3 = 'audio/mpeg', 768061847f8eSopenharmony_ci /** 768161847f8eSopenharmony_ci * G711-mulaw codec MIME type. 768261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core 768361847f8eSopenharmony_ci * @since 12 768461847f8eSopenharmony_ci */ 768561847f8eSopenharmony_ci AUDIO_G711MU = 'audio/g711mu', 768661847f8eSopenharmony_ci } 768761847f8eSopenharmony_ci 768861847f8eSopenharmony_ci /** 768961847f8eSopenharmony_ci * Enumerates AVScreenCaptureRecord preset types. 769061847f8eSopenharmony_ci * 769161847f8eSopenharmony_ci * @enum { number } 769261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 769361847f8eSopenharmony_ci * @since 12 769461847f8eSopenharmony_ci */ 769561847f8eSopenharmony_ci enum AVScreenCaptureRecordPreset { 769661847f8eSopenharmony_ci /** 769761847f8eSopenharmony_ci * Screen record normal type, h264/aac mp4 769861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 769961847f8eSopenharmony_ci * @since 12 770061847f8eSopenharmony_ci */ 770161847f8eSopenharmony_ci SCREEN_RECORD_PRESET_H264_AAC_MP4 = 0, 770261847f8eSopenharmony_ci /** 770361847f8eSopenharmony_ci * Screen record high efficient type, h265/aac mp4 770461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 770561847f8eSopenharmony_ci * @since 12 770661847f8eSopenharmony_ci */ 770761847f8eSopenharmony_ci SCREEN_RECORD_PRESET_H265_AAC_MP4 = 1, 770861847f8eSopenharmony_ci } 770961847f8eSopenharmony_ci 771061847f8eSopenharmony_ci /** 771161847f8eSopenharmony_ci * Enumerates AVScreenCapture callback state type. 771261847f8eSopenharmony_ci * 771361847f8eSopenharmony_ci * @enum { number } 771461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 771561847f8eSopenharmony_ci * @since 12 771661847f8eSopenharmony_ci */ 771761847f8eSopenharmony_ci enum AVScreenCaptureStateCode { 771861847f8eSopenharmony_ci /** 771961847f8eSopenharmony_ci * Screen capture started 772061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 772161847f8eSopenharmony_ci * @since 12 772261847f8eSopenharmony_ci */ 772361847f8eSopenharmony_ci SCREENCAPTURE_STATE_STARTED = 0, 772461847f8eSopenharmony_ci /** 772561847f8eSopenharmony_ci * Screen capture canceled 772661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 772761847f8eSopenharmony_ci * @since 12 772861847f8eSopenharmony_ci */ 772961847f8eSopenharmony_ci SCREENCAPTURE_STATE_CANCELED = 1, 773061847f8eSopenharmony_ci /** 773161847f8eSopenharmony_ci * Screen capture stopped by user 773261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 773361847f8eSopenharmony_ci * @since 12 773461847f8eSopenharmony_ci */ 773561847f8eSopenharmony_ci SCREENCAPTURE_STATE_STOPPED_BY_USER = 2, 773661847f8eSopenharmony_ci /** 773761847f8eSopenharmony_ci * Screen capture stopped by interrupt 773861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 773961847f8eSopenharmony_ci * @since 12 774061847f8eSopenharmony_ci */ 774161847f8eSopenharmony_ci SCREENCAPTURE_STATE_INTERRUPTED_BY_OTHER = 3, 774261847f8eSopenharmony_ci /** 774361847f8eSopenharmony_ci * Screen capture stopped by phone call 774461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 774561847f8eSopenharmony_ci * @since 12 774661847f8eSopenharmony_ci */ 774761847f8eSopenharmony_ci SCREENCAPTURE_STATE_STOPPED_BY_CALL = 4, 774861847f8eSopenharmony_ci /** 774961847f8eSopenharmony_ci * Screen capture microphone not available 775061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 775161847f8eSopenharmony_ci * @since 12 775261847f8eSopenharmony_ci */ 775361847f8eSopenharmony_ci SCREENCAPTURE_STATE_MIC_UNAVAILABLE = 5, 775461847f8eSopenharmony_ci /** 775561847f8eSopenharmony_ci * Screen capture microphone is muted by user 775661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 775761847f8eSopenharmony_ci * @since 12 775861847f8eSopenharmony_ci */ 775961847f8eSopenharmony_ci SCREENCAPTURE_STATE_MIC_MUTED_BY_USER = 6, 776061847f8eSopenharmony_ci /** 776161847f8eSopenharmony_ci * Screen capture microphone is unmuted by user 776261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 776361847f8eSopenharmony_ci * @since 12 776461847f8eSopenharmony_ci */ 776561847f8eSopenharmony_ci SCREENCAPTURE_STATE_MIC_UNMUTED_BY_USER = 7, 776661847f8eSopenharmony_ci /** 776761847f8eSopenharmony_ci * Screen capture enter private scene 776861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 776961847f8eSopenharmony_ci * @since 12 777061847f8eSopenharmony_ci */ 777161847f8eSopenharmony_ci SCREENCAPTURE_STATE_ENTER_PRIVATE_SCENE = 8, 777261847f8eSopenharmony_ci /** 777361847f8eSopenharmony_ci * Screen capture exit private scene 777461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 777561847f8eSopenharmony_ci * @since 12 777661847f8eSopenharmony_ci */ 777761847f8eSopenharmony_ci SCREENCAPTURE_STATE_EXIT_PRIVATE_SCENE = 9, 777861847f8eSopenharmony_ci /** 777961847f8eSopenharmony_ci * Screen capture stopped by user switches 778061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 778161847f8eSopenharmony_ci * @since 12 778261847f8eSopenharmony_ci */ 778361847f8eSopenharmony_ci SCREENCAPTURE_STATE_STOPPED_BY_USER_SWITCHES = 10, 778461847f8eSopenharmony_ci } 778561847f8eSopenharmony_ci 778661847f8eSopenharmony_ci /** 778761847f8eSopenharmony_ci * Provides the media AVScreenCaptureRecord config definition. 778861847f8eSopenharmony_ci * 778961847f8eSopenharmony_ci * @typedef AVScreenCaptureRecordConfig 779061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 779161847f8eSopenharmony_ci * @since 12 779261847f8eSopenharmony_ci */ 779361847f8eSopenharmony_ci interface AVScreenCaptureRecordConfig { 779461847f8eSopenharmony_ci /** 779561847f8eSopenharmony_ci * Indicates record file descriptor. 779661847f8eSopenharmony_ci * @type { number } 779761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 779861847f8eSopenharmony_ci * @since 12 779961847f8eSopenharmony_ci */ 780061847f8eSopenharmony_ci fd: number; 780161847f8eSopenharmony_ci /** 780261847f8eSopenharmony_ci * Indicates video frame width. 780361847f8eSopenharmony_ci * @type { ?number } 780461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 780561847f8eSopenharmony_ci * @since 12 780661847f8eSopenharmony_ci */ 780761847f8eSopenharmony_ci frameWidth?: number; 780861847f8eSopenharmony_ci /** 780961847f8eSopenharmony_ci * Indicates video frame height. 781061847f8eSopenharmony_ci * @type { ?number } 781161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 781261847f8eSopenharmony_ci * @since 12 781361847f8eSopenharmony_ci */ 781461847f8eSopenharmony_ci frameHeight?: number; 781561847f8eSopenharmony_ci /** 781661847f8eSopenharmony_ci * Indicates video bitrate. 781761847f8eSopenharmony_ci * @type { ?number } 781861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 781961847f8eSopenharmony_ci * @since 12 782061847f8eSopenharmony_ci */ 782161847f8eSopenharmony_ci videoBitrate?: number; 782261847f8eSopenharmony_ci /** 782361847f8eSopenharmony_ci * Indicates audio sample rate. 782461847f8eSopenharmony_ci * @type { ?number } 782561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 782661847f8eSopenharmony_ci * @since 12 782761847f8eSopenharmony_ci */ 782861847f8eSopenharmony_ci audioSampleRate?: number; 782961847f8eSopenharmony_ci /** 783061847f8eSopenharmony_ci * Indicates audio channel count. 783161847f8eSopenharmony_ci * @type { ?number } 783261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 783361847f8eSopenharmony_ci * @since 12 783461847f8eSopenharmony_ci */ 783561847f8eSopenharmony_ci audioChannelCount?: number; 783661847f8eSopenharmony_ci /** 783761847f8eSopenharmony_ci * Indicates audio bitrate. 783861847f8eSopenharmony_ci * @type { ?number } 783961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 784061847f8eSopenharmony_ci * @since 12 784161847f8eSopenharmony_ci */ 784261847f8eSopenharmony_ci audioBitrate?: number; 784361847f8eSopenharmony_ci /** 784461847f8eSopenharmony_ci * Indicates AVScreenCaptureRecordPreset, details see @AVScreenCaptureRecordPreset 784561847f8eSopenharmony_ci * @type { ?AVScreenCaptureRecordPreset } 784661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 784761847f8eSopenharmony_ci * @since 12 784861847f8eSopenharmony_ci */ 784961847f8eSopenharmony_ci preset?: AVScreenCaptureRecordPreset; 785061847f8eSopenharmony_ci } 785161847f8eSopenharmony_ci 785261847f8eSopenharmony_ci /** 785361847f8eSopenharmony_ci * Provides screen capture record. Before calling an AVScreenCaptureRecorder method, you must use createAVScreenCaptureRecorder() 785461847f8eSopenharmony_ci * to create an AVScreenCaptureRecorder instance. 785561847f8eSopenharmony_ci * 785661847f8eSopenharmony_ci * @typedef AVScreenCaptureRecorder 785761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 785861847f8eSopenharmony_ci * @since 12 785961847f8eSopenharmony_ci */ 786061847f8eSopenharmony_ci interface AVScreenCaptureRecorder { 786161847f8eSopenharmony_ci /** 786261847f8eSopenharmony_ci * Init AVScreenCaptureRecorder. 786361847f8eSopenharmony_ci * @param { AVScreenCaptureRecordConfig } config - AVScreenCaptureRecorder config. 786461847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when init completed. 786561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 786661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. Return by promise. 786761847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 786861847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 786961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 787061847f8eSopenharmony_ci * @since 12 787161847f8eSopenharmony_ci */ 787261847f8eSopenharmony_ci init(config: AVScreenCaptureRecordConfig): Promise<void>; 787361847f8eSopenharmony_ci 787461847f8eSopenharmony_ci /** 787561847f8eSopenharmony_ci * Start screen capture recording. 787661847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when startRecording completed. 787761847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 787861847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 787961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 788061847f8eSopenharmony_ci * @since 12 788161847f8eSopenharmony_ci */ 788261847f8eSopenharmony_ci startRecording(): Promise<void>; 788361847f8eSopenharmony_ci 788461847f8eSopenharmony_ci /** 788561847f8eSopenharmony_ci * Stop screen capture recording. 788661847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when stopRecording completed. 788761847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 788861847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 788961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 789061847f8eSopenharmony_ci * @since 12 789161847f8eSopenharmony_ci */ 789261847f8eSopenharmony_ci stopRecording(): Promise<void>; 789361847f8eSopenharmony_ci 789461847f8eSopenharmony_ci /** 789561847f8eSopenharmony_ci * Skip some windows' privacy mode of current app during the screen recording. 789661847f8eSopenharmony_ci * @param { Array<number> } windowIDs - windowID list to be skipped privacy mode . 789761847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when skipPrivacyMode completed. 789861847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 789961847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 790061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 790161847f8eSopenharmony_ci * @since 12 790261847f8eSopenharmony_ci */ 790361847f8eSopenharmony_ci skipPrivacyMode(windowIDs: Array<number>): Promise<void>; 790461847f8eSopenharmony_ci 790561847f8eSopenharmony_ci /** 790661847f8eSopenharmony_ci * Set microphone enable or disable. 790761847f8eSopenharmony_ci * @param { boolean } enable - Set microphone enable or disable during recording. 790861847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when setMicEnabled completed. 790961847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 791061847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 791161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 791261847f8eSopenharmony_ci * @since 12 791361847f8eSopenharmony_ci */ 791461847f8eSopenharmony_ci setMicEnabled(enable: boolean): Promise<void>; 791561847f8eSopenharmony_ci 791661847f8eSopenharmony_ci /** 791761847f8eSopenharmony_ci * Release screen capture recording. 791861847f8eSopenharmony_ci * @returns { Promise<void> } A Promise instance used to return when release completed. 791961847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 792061847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 792161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 792261847f8eSopenharmony_ci * @since 12 792361847f8eSopenharmony_ci */ 792461847f8eSopenharmony_ci release(): Promise<void>; 792561847f8eSopenharmony_ci 792661847f8eSopenharmony_ci /** 792761847f8eSopenharmony_ci * Listens for AVScreenCaptureRecord info callback. 792861847f8eSopenharmony_ci * @param { 'stateChange' } type - Type of the AVScreenCaptureRecord event to listen for. 792961847f8eSopenharmony_ci * @param { Callback<AVScreenCaptureStateCode> } callback - Callback used to listen for the AVScreenCaptureRecord info return. 793061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 793161847f8eSopenharmony_ci * @since 12 793261847f8eSopenharmony_ci */ 793361847f8eSopenharmony_ci on(type: 'stateChange', callback: Callback<AVScreenCaptureStateCode>): void; 793461847f8eSopenharmony_ci 793561847f8eSopenharmony_ci /** 793661847f8eSopenharmony_ci * Listens for AVScreenCaptureRecord info callback. 793761847f8eSopenharmony_ci * @param { 'error' } type - Type of the AVScreenCaptureRecord event to listen for. 793861847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the AVScreenCaptureRecord error return. 793961847f8eSopenharmony_ci * @throws { BusinessError } 201 - permission denied. 794061847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by ErrorCallback. 794161847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by ErrorCallback. 794261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 794361847f8eSopenharmony_ci * @since 12 794461847f8eSopenharmony_ci */ 794561847f8eSopenharmony_ci on(type: 'error', callback: ErrorCallback): void; 794661847f8eSopenharmony_ci 794761847f8eSopenharmony_ci /** 794861847f8eSopenharmony_ci * Unregister listens for AVScreenCaptureRecord info callback. 794961847f8eSopenharmony_ci * @param { 'stateChange' } type - Type of the AVScreenCaptureRecord event to listen for. 795061847f8eSopenharmony_ci * @param { Callback<AVScreenCaptureStateCode> } callback - Callback used to listen for the AVScreenCaptureRecord info return. 795161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 795261847f8eSopenharmony_ci * @since 12 795361847f8eSopenharmony_ci */ 795461847f8eSopenharmony_ci off(type: 'stateChange', callback?: Callback<AVScreenCaptureStateCode>): void; 795561847f8eSopenharmony_ci 795661847f8eSopenharmony_ci /** 795761847f8eSopenharmony_ci * Unregister listens for AVScreenCaptureRecord error callback. 795861847f8eSopenharmony_ci * @param { 'error' } type - Type of the AVScreenCaptureRecord event to listen for. 795961847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the AVScreenCaptureRecord error return. 796061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVScreenCapture 796161847f8eSopenharmony_ci * @since 12 796261847f8eSopenharmony_ci */ 796361847f8eSopenharmony_ci off(type: 'error', callback?: ErrorCallback): void; 796461847f8eSopenharmony_ci } 796561847f8eSopenharmony_ci 796661847f8eSopenharmony_ci /** 796761847f8eSopenharmony_ci * Provides the video transcode configuration definitions 796861847f8eSopenharmony_ci * 796961847f8eSopenharmony_ci * @typedef AVTranscoderConfig 797061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 797161847f8eSopenharmony_ci * @since 12 797261847f8eSopenharmony_ci */ 797361847f8eSopenharmony_ci interface AVTranscoderConfig { 797461847f8eSopenharmony_ci /** 797561847f8eSopenharmony_ci * Indicates the audio bitrate. 797661847f8eSopenharmony_ci * @type { ?number } 797761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 797861847f8eSopenharmony_ci * @since 12 797961847f8eSopenharmony_ci */ 798061847f8eSopenharmony_ci audioBitrate?: number; 798161847f8eSopenharmony_ci 798261847f8eSopenharmony_ci /** 798361847f8eSopenharmony_ci * Indicates the audio encoding format. 798461847f8eSopenharmony_ci * @type { ?CodecMimeType } 798561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 798661847f8eSopenharmony_ci * @since 12 798761847f8eSopenharmony_ci */ 798861847f8eSopenharmony_ci audioCodec?: CodecMimeType; 798961847f8eSopenharmony_ci 799061847f8eSopenharmony_ci /** 799161847f8eSopenharmony_ci * Indicates the output file format. 799261847f8eSopenharmony_ci * @type { ContainerFormatType } 799361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 799461847f8eSopenharmony_ci * @since 12 799561847f8eSopenharmony_ci */ 799661847f8eSopenharmony_ci fileFormat: ContainerFormatType; 799761847f8eSopenharmony_ci 799861847f8eSopenharmony_ci /** 799961847f8eSopenharmony_ci * Indicates the video bitrate. 800061847f8eSopenharmony_ci * @type { ?number } 800161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 800261847f8eSopenharmony_ci * @since 12 800361847f8eSopenharmony_ci */ 800461847f8eSopenharmony_ci videoBitrate?: number; 800561847f8eSopenharmony_ci 800661847f8eSopenharmony_ci /** 800761847f8eSopenharmony_ci * Indicates the video encoding foramt. 800861847f8eSopenharmony_ci * @type { ?CodecMimeType } 800961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 801061847f8eSopenharmony_ci * @since 12 801161847f8eSopenharmony_ci */ 801261847f8eSopenharmony_ci videoCodec?: CodecMimeType; 801361847f8eSopenharmony_ci 801461847f8eSopenharmony_ci /** 801561847f8eSopenharmony_ci * Indicates the video width. 801661847f8eSopenharmony_ci * @type { ?number } 801761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 801861847f8eSopenharmony_ci * @since 12 801961847f8eSopenharmony_ci */ 802061847f8eSopenharmony_ci videoFrameWidth?: number; 802161847f8eSopenharmony_ci 802261847f8eSopenharmony_ci /** 802361847f8eSopenharmony_ci * Indicates the video height. 802461847f8eSopenharmony_ci * @type { ?number } 802561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 802661847f8eSopenharmony_ci * @since 12 802761847f8eSopenharmony_ci */ 802861847f8eSopenharmony_ci videoFrameHeight?: number; 802961847f8eSopenharmony_ci } 803061847f8eSopenharmony_ci 803161847f8eSopenharmony_ci /** 803261847f8eSopenharmony_ci * Transcode a source video file to a destination video file. 803361847f8eSopenharmony_ci * Before calling an AVTranscoder method, you must use @createAVTranscoder 803461847f8eSopenharmony_ci * to create an AVTranscoder instance. 803561847f8eSopenharmony_ci * 803661847f8eSopenharmony_ci * @typedef AVTranscoder 803761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 803861847f8eSopenharmony_ci * @since 12 803961847f8eSopenharmony_ci */ 804061847f8eSopenharmony_ci interface AVTranscoder { 804161847f8eSopenharmony_ci /** 804261847f8eSopenharmony_ci * Source media file descriptor. Mainstream media formats are supported. 804361847f8eSopenharmony_ci * @type { AVFileDescriptor } 804461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 804561847f8eSopenharmony_ci * @since 12 804661847f8eSopenharmony_ci */ 804761847f8eSopenharmony_ci fdSrc: AVFileDescriptor; 804861847f8eSopenharmony_ci 804961847f8eSopenharmony_ci /** 805061847f8eSopenharmony_ci * Destination media file descriptor. Mainstream media formats are supported. 805161847f8eSopenharmony_ci * @type { number } 805261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 805361847f8eSopenharmony_ci * @since 12 805461847f8eSopenharmony_ci */ 805561847f8eSopenharmony_ci fdDst: number; 805661847f8eSopenharmony_ci 805761847f8eSopenharmony_ci /** 805861847f8eSopenharmony_ci * Prepares for transcoding. 805961847f8eSopenharmony_ci * @param { AVTranscoderConfig } config : Recording parameters. 806061847f8eSopenharmony_ci * @returns { Promise<void> } A promise instance used to return when prepare completes. 806161847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Return by promise. 806261847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 806361847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 806461847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. 806561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 806661847f8eSopenharmony_ci * @since 12 806761847f8eSopenharmony_ci */ 806861847f8eSopenharmony_ci prepare(config: AVTranscoderConfig): Promise<void>; 806961847f8eSopenharmony_ci 807061847f8eSopenharmony_ci /** 807161847f8eSopenharmony_ci * Start AVTranscoder. 807261847f8eSopenharmony_ci * @returns { Promise<void> } A promise instance used to return when start completes. 807361847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 807461847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 807561847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 807661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 807761847f8eSopenharmony_ci * @since 12 807861847f8eSopenharmony_ci */ 807961847f8eSopenharmony_ci start(): Promise<void>; 808061847f8eSopenharmony_ci 808161847f8eSopenharmony_ci /** 808261847f8eSopenharmony_ci * Pause AVTranscoder. 808361847f8eSopenharmony_ci * @returns { Promise<void> } A promise instance used to return when pause completes. 808461847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 808561847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 808661847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 808761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 808861847f8eSopenharmony_ci * @since 12 808961847f8eSopenharmony_ci */ 809061847f8eSopenharmony_ci pause(): Promise<void>; 809161847f8eSopenharmony_ci 809261847f8eSopenharmony_ci /** 809361847f8eSopenharmony_ci * Resume AVTranscoder. 809461847f8eSopenharmony_ci * @returns { Promise<void> } A promise instance used to return when resume completes. 809561847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 809661847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 809761847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 809861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 809961847f8eSopenharmony_ci * @since 12 810061847f8eSopenharmony_ci */ 810161847f8eSopenharmony_ci resume(): Promise<void>; 810261847f8eSopenharmony_ci 810361847f8eSopenharmony_ci /** 810461847f8eSopenharmony_ci * Cancel AVTranscoder. 810561847f8eSopenharmony_ci * @returns { Promise<void> } A promise instance used to return when cancel completes. 810661847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 810761847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - IO error. Return by promise. 810861847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 810961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 811061847f8eSopenharmony_ci * @since 12 811161847f8eSopenharmony_ci */ 811261847f8eSopenharmony_ci cancel(): Promise<void>; 811361847f8eSopenharmony_ci 811461847f8eSopenharmony_ci /** 811561847f8eSopenharmony_ci * Release resources used for AVTranscoder. 811661847f8eSopenharmony_ci * @returns { Promise<void> } A promise instance used to return when cancel completes. 811761847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. 811861847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. Return by promise. 811961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 812061847f8eSopenharmony_ci * @since 12 812161847f8eSopenharmony_ci */ 812261847f8eSopenharmony_ci release(): Promise<void>; 812361847f8eSopenharmony_ci 812461847f8eSopenharmony_ci /** 812561847f8eSopenharmony_ci * Register listener for trancoding complete event. 812661847f8eSopenharmony_ci * @param { 'complete' } type - Type of the event to listen for. 812761847f8eSopenharmony_ci * @param { Callback<void> } callback - Callback used to listen for the complete event. 812861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 812961847f8eSopenharmony_ci * @since 12 813061847f8eSopenharmony_ci */ 813161847f8eSopenharmony_ci on(type:'complete', callback: Callback<void>):void; 813261847f8eSopenharmony_ci 813361847f8eSopenharmony_ci /** 813461847f8eSopenharmony_ci * Register listener for trancoding error event. 813561847f8eSopenharmony_ci * @param { 'error' } type - Type of the event to listen for. 813661847f8eSopenharmony_ci * @param { ErrorCallback } callback - Callback used to listen for the error event. 813761847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. 813861847f8eSopenharmony_ci * @throws { BusinessError } 801 - Capability not supported. 813961847f8eSopenharmony_ci * @throws { BusinessError } 5400101 - No memory. 814061847f8eSopenharmony_ci * @throws { BusinessError } 5400102 - Operation not allowed. 814161847f8eSopenharmony_ci * @throws { BusinessError } 5400103 - I/O error. 814261847f8eSopenharmony_ci * @throws { BusinessError } 5400104 - Time out. 814361847f8eSopenharmony_ci * @throws { BusinessError } 5400105 - Service died. 814461847f8eSopenharmony_ci * @throws { BusinessError } 5400106 - Unsupport format. 814561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 814661847f8eSopenharmony_ci * @since 12 814761847f8eSopenharmony_ci */ 814861847f8eSopenharmony_ci on(type:'error', callback: ErrorCallback):void; 814961847f8eSopenharmony_ci 815061847f8eSopenharmony_ci /** 815161847f8eSopenharmony_ci * Register listener for trancoding progressUpdate event. 815261847f8eSopenharmony_ci * @param { 'progressUpdate' } type - Type of the event to listen for. 815361847f8eSopenharmony_ci * @param { Callback<number> } callback - Callback used to listen for the progressUpdate event. 815461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 815561847f8eSopenharmony_ci * @since 12 815661847f8eSopenharmony_ci */ 815761847f8eSopenharmony_ci on(type:'progressUpdate', callback: Callback<number>):void; 815861847f8eSopenharmony_ci 815961847f8eSopenharmony_ci /** 816061847f8eSopenharmony_ci * Unregister listener for trancoding complete event. 816161847f8eSopenharmony_ci * @param { 'complete' } type - Type of the event to listen for. 816261847f8eSopenharmony_ci * @param { Callback<void> } [callback] - Callback used to listen for the complete event. 816361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 816461847f8eSopenharmony_ci * @since 12 816561847f8eSopenharmony_ci */ 816661847f8eSopenharmony_ci off(type:'complete', callback?: Callback<void>):void; 816761847f8eSopenharmony_ci 816861847f8eSopenharmony_ci /** 816961847f8eSopenharmony_ci * Unregister listener for trancoding error event. 817061847f8eSopenharmony_ci * @param { 'error' } type - Type of the event to listen for. 817161847f8eSopenharmony_ci * @param { ErrorCallback } [callback] - Callback used to listen for the error event. 817261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 817361847f8eSopenharmony_ci * @since 12 817461847f8eSopenharmony_ci */ 817561847f8eSopenharmony_ci off(type:'error', callback?: ErrorCallback):void; 817661847f8eSopenharmony_ci 817761847f8eSopenharmony_ci /** 817861847f8eSopenharmony_ci * Unregister listener for trancoding progressUpdate event. 817961847f8eSopenharmony_ci * @param { 'progressUpdate' } type - Type of the event to listen for. 818061847f8eSopenharmony_ci * @param { Callback<number> } [callback] - Callback used to listen for the progressUpdate event. 818161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Media.AVTranscoder 818261847f8eSopenharmony_ci * @since 12 818361847f8eSopenharmony_ci */ 818461847f8eSopenharmony_ci off(type:'progressUpdate', callback?: Callback<number>):void; 818561847f8eSopenharmony_ci } 818661847f8eSopenharmony_ci} 818761847f8eSopenharmony_ciexport default media; 8188