diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index ba9645edc9171895a40e2693093f433d7f0a44a4..a54aca509593c5c35e4b3d7b2313ac8a4de952ed 100644 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -21,9 +21,9 @@ import { ErrorCallback, AsyncCallback, Callback, BusinessError } from './@ohos.base'; import audio from "./@ohos.multimedia.audio"; import photoAccessHelper from './@ohos.file.photoAccessHelper'; -import image from './@ohos.multimedia.image'; -import { SoundPool as _SoundPool } from './multimedia/soundPool'; -import { PlayParameters as _PlayParameters } from './multimedia/soundPool'; +import type image from './@ohos.multimedia.image'; +import type { SoundPool as _SoundPool } from './multimedia/soundPool'; +import type { PlayParameters as _PlayParameters } from './multimedia/soundPool'; import type drm from './@ohos.multimedia.drm'; /** @@ -66,10 +66,20 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function createAVPlayer(callback: AsyncCallback): void; + /** + * Creates an AVPlayer instance. + * @param { AsyncCallback } callback - used to return AVPlayer instance if the operation is successful; returns null otherwise. + * @throws { BusinessError } 5400101 - No memory. Return by callback. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function createAVPlayer(callback: AsyncCallback): void; /** * Creates an AVPlayer instance. @@ -93,10 +103,20 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function createAVPlayer(): Promise; + /** + * Creates an AVPlayer instance. + * @returns { Promise } A Promise instance used to return AVPlayer instance if the operation is successful; returns null otherwise. + * @throws { BusinessError } 5400101 - No memory. Return by promise. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function createAVPlayer(): Promise; /** * Creates an AVRecorder instance. @@ -111,10 +131,19 @@ declare namespace media { * @throws { BusinessError } 5400101 - No memory. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function createAVRecorder(callback: AsyncCallback): void; + /** + * Creates an AVRecorder instance. + * @param { AsyncCallback } callback - used to return AVRecorder instance if the operation is successful; returns null otherwise. + * @throws { BusinessError } 5400101 - No memory. Return by callback. + * @syscap SystemCapability.Multimedia.Media.AVRecorder + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + function createAVRecorder(callback: AsyncCallback): void; /** * Creates an AVRecorder instance. @@ -130,10 +159,20 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function createAVRecorder(): Promise; + /** + * Creates an AVRecorder instance. + * @returns { Promise } A Promise instance used to return AVRecorder instance if the operation is successful; returns null otherwise. + * @throws { BusinessError } 5400101 - No memory. Return by promise. + * @syscap SystemCapability.Multimedia.Media.AVRecorder + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function createAVRecorder(): Promise; /** * Creates an AudioPlayer instance. @@ -179,6 +218,20 @@ declare namespace media { * @since 13 */ function createMediaSourceWithUrl(url: string, headers?: Record): MediaSource; + /** + * Create MediaSource from url. + * @param { string } url : The location for the media source. + * @param { Record } headers : Headers attached to network request while player request data. + * @returns { MediaSource | undefined } MediaSource instance if the operation is successful; returns null otherwise. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3.Parameter verification failed. + * @throws { BusinessError } 5400101 - No memory. + * @syscap SystemCapability.Multimedia.Media.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function createMediaSourceWithUrl(url: string, headers?: Record): MediaSource | undefined; /** * Create media source from media stream array. @@ -190,6 +243,17 @@ declare namespace media { * @since 18 */ function createMediaSourceWithStreamData(streams: Array): MediaSource; + /** + * Create media source from media stream array. + * @param { Array } streams - The player uses it to get stream source info. + * @returns { MediaSource | undefined } MediaSource instance if the operation is successful; returns null otherwise. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + * @syscap SystemCapability.Multimedia.Media.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function createMediaSourceWithStreamData(streams: Array): MediaSource | undefined; /** * Creates an VideoPlayer instance. @@ -228,10 +292,21 @@ declare namespace media { * @throws { BusinessError } 5400101 - No memory. Return by callback. * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function createVideoRecorder(callback: AsyncCallback): void; + /** + * The maintenance of this interface has been stopped since version api 9. Please use AVRecorder + * Creates an VideoRecorder instance. + * @param { AsyncCallback } callback - used to return AudioPlayer instance if the operation is successful; returns null otherwise. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 5400101 - No memory. Return by callback. + * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function createVideoRecorder(callback: AsyncCallback): void; /** * The maintenance of this interface has been stopped since version api 9. Please use AVRecorder @@ -250,40 +325,77 @@ declare namespace media { * @throws { BusinessError } 5400101 - No memory. Return by promise. * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function createVideoRecorder(): Promise; + /** + * The maintenance of this interface has been stopped since version api 9. Please use AVRecorder + * Creates an VideoRecorder instance. + * @returns { Promise } A Promise instance used to return VideoRecorder instance if the operation is successful; returns null otherwise. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 5400101 - No memory. Return by promise. + * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function createVideoRecorder(): Promise; /** * Creates a soundPool instance. * - * @param {int} maxStreams The maximum number of simultaneous streams for this soundPool instance + * @param {number} maxStreams The maximum number of simultaneous streams for this soundPool instance * @param {audio.AudioRendererInfo} audioRenderInfo Audio renderer information * @param {AsyncCallback} callback Callback used to return soundPool instance if the operation is successful; returns null otherwise. * @throws { BusinessError } 5400101 - No memory. Return by callback. * @syscap SystemCapability.Multimedia.Media.SoundPool - * @since arkts {'1.1':'10','1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function createSoundPool( - maxStreams: int, + maxStreams: number, audioRenderInfo: audio.AudioRendererInfo, callback: AsyncCallback ): void; + /** + * Creates a soundPool instance. + * + * @param {number} maxStreams The maximum number of simultaneous streams for this soundPool instance + * @param {audio.AudioRendererInfo} audioRenderInfo Audio renderer information + * @param {AsyncCallback} callback Callback used to return soundPool instance if the operation is successful; returns null otherwise. + * @throws { BusinessError } 5400101 - No memory. Return by callback. + * @syscap SystemCapability.Multimedia.Media.SoundPool + * @since 20 + * @arkts 1.2 + */ + function createSoundPool( + maxStreams: number, + audioRenderInfo: audio.AudioRendererInfo, + callback: AsyncCallback + ): void; /** * Creates a soundPool instance. * - * @param {int} maxStreams The maximum number of simultaneous streams for this soundPool instance + * @param {number} maxStreams The maximum number of simultaneous streams for this soundPool instance * @param {audio.AudioRendererInfo} audioRenderInfo Audio renderer information * @returns {Promise} A Promise instance used to return SoundPool instance if the operation is successful; returns null otherwise. * @throws { BusinessError } 5400101 - No memory. Return by promise. * @syscap SystemCapability.Multimedia.Media.SoundPool - * @since arkts {'1.1':'10','1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ - function createSoundPool(maxStreams: int, audioRenderInfo: audio.AudioRendererInfo): Promise; + function createSoundPool(maxStreams: number, audioRenderInfo: audio.AudioRendererInfo): Promise; + /** + * Creates a soundPool instance. + * + * @param {number} maxStreams The maximum number of simultaneous streams for this soundPool instance + * @param {audio.AudioRendererInfo} audioRenderInfo Audio renderer information + * @returns {Promise} A Promise instance used to return SoundPool instance if the operation is successful; returns null otherwise. + * @throws { BusinessError } 5400101 - No memory. Return by promise. + * @syscap SystemCapability.Multimedia.Media.SoundPool + * @since 20 + * @arkts 1.2 + */ + function createSoundPool(maxStreams: number, audioRenderInfo: audio.AudioRendererInfo): Promise; /** * Creates an AVScreenCaptureRecorder instance. @@ -291,10 +403,19 @@ declare namespace media { * returns null otherwise. * @throws { BusinessError } 5400101 - No memory. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function createAVScreenCaptureRecorder(): Promise; + /** + * Creates an AVScreenCaptureRecorder instance. + * @returns { Promise } A Promise instance used to return AVScreenCaptureRecorder instance if the operation is successful; + * returns null otherwise. + * @throws { BusinessError } 5400101 - No memory. Return by promise. + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @since 20 + * @arkts 1.2 + */ + function createAVScreenCaptureRecorder(): Promise; /** * Report user choice back to AVScreenCapture server @@ -307,7 +428,8 @@ declare namespace media { * @throws { BusinessError } 5400101 - No memory. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @systemapi - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ function reportAVScreenCaptureUserChoice(sessionId: number, choice: string): Promise; @@ -317,10 +439,19 @@ declare namespace media { * @returns {Promise} A Promise instance used to return AVTranscoder instance if the operation is successful; returns null otherwise. * @throws { BusinessError } 5400101 - No memory. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVTranscoder - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function createAVTranscoder(): Promise; + /** + * Creates a AVTranscoder instance. + * + * @returns {Promise} A Promise instance used to return AVTranscoder instance if the operation is successful; returns null otherwise. + * @throws { BusinessError } 5400101 - No memory. Return by promise. + * @syscap SystemCapability.Multimedia.Media.AVTranscoder + * @since 20 + * @arkts 1.2 + */ + function createAVTranscoder(): Promise; /** * Get the ScreenCaptureMonitor instance @@ -331,10 +462,22 @@ declare namespace media { * @throws { BusinessError } 5400101 - No memory. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @systemapi - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ function getScreenCaptureMonitor(): Promise; + /** + * Get the ScreenCaptureMonitor instance + * + * @returns { Promise } A Promise instance used to return ScreenCaptureMonitor instance if the operation is successful; + * returns null otherwise. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 5400101 - No memory. Return by promise. + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getScreenCaptureMonitor(): Promise; /** * Manages and plays sound. Before calling an SoundPool method, you must use createSoundPool() @@ -441,10 +584,20 @@ declare namespace media { * @throws { BusinessError } 5400101 - No memory. Returned by promise. * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor * @crossplatform - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function createAVMetadataExtractor(): Promise; + /** + * Creates an AVMetadataExtractor instance. + * @returns { Promise } A Promise instance used to return AVMetadataExtractor instance + * if the operation is successful; returns null otherwise. + * @throws { BusinessError } 5400101 - No memory. Returned by promise. + * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + function createAVMetadataExtractor(): Promise; /** * Creates an AVMetadataExtractor instance. @@ -461,10 +614,20 @@ declare namespace media { * @throws { BusinessError } 5400101 - No memory. Returned by callback. * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor * @crossplatform - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function createAVMetadataExtractor(callback: AsyncCallback): void; + /** + * Creates an AVMetadataExtractor instance. + * @param { AsyncCallback } callback - Callback used to return AVMetadataExtractor instance + * if the operation is successful; returns null otherwise. + * @throws { BusinessError } 5400101 - No memory. Returned by callback. + * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + function createAVMetadataExtractor(callback: AsyncCallback): void; /** * Creates an AVImageGenerator instance. @@ -472,10 +635,19 @@ declare namespace media { * if the operation is successful; returns null otherwise. * @throws { BusinessError } 5400101 - No memory. Returned by promise. * @syscap SystemCapability.Multimedia.Media.AVImageGenerator - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function createAVImageGenerator(): Promise; + /** + * Creates an AVImageGenerator instance. + * @returns { Promise } A Promise instance used to return AVImageGenerator instance + * if the operation is successful; returns null otherwise. + * @throws { BusinessError } 5400101 - No memory. Returned by promise. + * @syscap SystemCapability.Multimedia.Media.AVImageGenerator + * @since 20 + * @arkts 1.2 + */ + function createAVImageGenerator(): Promise; /** * Creates an AVImageGenerator instance. @@ -483,10 +655,19 @@ declare namespace media { * if the operation is successful; returns null otherwise. * @throws { BusinessError } 5400101 - No memory. Returned by callback. * @syscap SystemCapability.Multimedia.Media.AVImageGenerator - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function createAVImageGenerator(callback: AsyncCallback): void; + /** + * Creates an AVImageGenerator instance. + * @param { AsyncCallback } callback - Callback used to return AVImageGenerator instance + * if the operation is successful; returns null otherwise. + * @throws { BusinessError } 5400101 - No memory. Returned by callback. + * @syscap SystemCapability.Multimedia.Media.AVImageGenerator + * @since 20 + * @arkts 1.2 + */ + function createAVImageGenerator(callback: AsyncCallback): void; /** * Fetch media meta data or audio art picture from source. Before calling an AVMetadataExtractor method, @@ -552,10 +733,20 @@ declare namespace media { * @throws { BusinessError } 5400106 - Unsupported format. Returned by callback. * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor * @crossplatform - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ fetchMetadata(callback: AsyncCallback): void; + /** + * It will extract the resource to fetch media meta data info. + * @param { AsyncCallback } callback - A callback instance used to return when fetchMetadata completed. + * @throws { BusinessError } 5400102 - Operation not allowed. Returned by callback. + * @throws { BusinessError } 5400106 - Unsupported format. Returned by callback. + * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + fetchMetadata(callback: AsyncCallback): void; /** * It will extract the resource to fetch media meta data info. @@ -572,10 +763,20 @@ declare namespace media { * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor * @crossplatform - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ fetchMetadata(): Promise; + /** + * It will extract the resource to fetch media meta data info. + * @returns { Promise } A Promise instance used to return when fetchMetadata completed. + * @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise. + * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. + * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + fetchMetadata(): Promise; /** * It will extract the audio resource to fetch an album cover. @@ -594,10 +795,21 @@ declare namespace media { * @throws { BusinessError } 5400106 - Unsupported format. Returned by callback. * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor * @crossplatform - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ fetchAlbumCover(callback: AsyncCallback): void; + /** + * It will extract the audio resource to fetch an album cover. + * @param { AsyncCallback } callback - A callback instance used + * to return when fetchAlbumCover completed. + * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. + * @throws { BusinessError } 5400106 - Unsupported format. Returned by callback. + * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + fetchAlbumCover(callback: AsyncCallback): void; /** * It will extract the audio resource to fetch an album cover. @@ -614,10 +826,20 @@ declare namespace media { * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor * @crossplatform - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ fetchAlbumCover(): Promise; + /** + * It will extract the audio resource to fetch an album cover. + * @returns { Promise } A Promise instance used to return when fetchAlbumCover completed. + * @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise. + * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. + * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + fetchAlbumCover(): Promise; /** * Get timestamp according to frame index. @@ -628,7 +850,8 @@ declare namespace media { * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor * @systemapi - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ getTimeByFrameIndex(index: number): Promise; @@ -641,7 +864,8 @@ declare namespace media { * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. * @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor * @systemapi - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ getFrameIndexByTime(timeUs: number): Promise; @@ -1084,7 +1308,7 @@ declare namespace media { /** * It will fetch a picture at @timeUs from the given video resource. - * @param { long } timeUs - The time expected to fetch picture from the video resource. + * @param { number } timeUs - The time expected to fetch picture from the video resource. * The unit is microsecond(us). * @param { AVImageQueryOptions } options - The time options about the relationship * between the given timeUs and a key frame, see @AVImageQueryOptions . @@ -1094,16 +1318,32 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. Returned by callback. * @throws { BusinessError } 5400106 - Unsupported format. Returned by callback. * @syscap SystemCapability.Multimedia.Media.AVImageGenerator - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ - fetchFrameByTime(timeUs: long, options: AVImageQueryOptions, param: PixelMapParams, + fetchFrameByTime(timeUs: number, options: AVImageQueryOptions, param: PixelMapParams, callback: AsyncCallback): void; + /** + * It will fetch a picture at @timeUs from the given video resource. + * @param { number } timeUs - The time expected to fetch picture from the video resource. + * The unit is microsecond(us). + * @param { AVImageQueryOptions } options - The time options about the relationship + * between the given timeUs and a key frame, see @AVImageQueryOptions . + * @param { PixelMapParams } param - The output pixel map format params, see @PixelMapParams . + * @param { AsyncCallback } callback - A callback instance used + * to return when fetchFrameByTime completed. + * @throws { BusinessError } 5400102 - Operation not allowed. Returned by callback. + * @throws { BusinessError } 5400106 - Unsupported format. Returned by callback. + * @syscap SystemCapability.Multimedia.Media.AVImageGenerator + * @since 20 + * @arkts 1.2 + */ + fetchFrameByTime(timeUs: number, options: AVImageQueryOptions, param: PixelMapParams, + callback: AsyncCallback): void; /** * It will decode the given video resource. Then fetch a picture * at @timeUs according the given @options and @param . - * @param { long } timeUs - The time expected to fetch picture from the video resource. + * @param { number } timeUs - The time expected to fetch picture from the video resource. * The unit is microsecond(us). * @param { AVImageQueryOptions } options - The time options about the relationship * between the given timeUs and a key frame, see @AVImageQueryOptions . @@ -1113,10 +1353,26 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise. * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. * @syscap SystemCapability.Multimedia.Media.AVImageGenerator - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 + */ + fetchFrameByTime(timeUs: number, options: AVImageQueryOptions, param: PixelMapParams): Promise; + /** + * It will decode the given video resource. Then fetch a picture + * at @timeUs according the given @options and @param . + * @param { number } timeUs - The time expected to fetch picture from the video resource. + * The unit is microsecond(us). + * @param { AVImageQueryOptions } options - The time options about the relationship + * between the given timeUs and a key frame, see @AVImageQueryOptions . + * @param { PixelMapParams } param - The output pixel map format params, see @PixelMapParams . + * @returns { Promise } A Promise instance used to return the pixel map + * when fetchFrameByTime completed. + * @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise. + * @throws { BusinessError } 5400106 - Unsupported format. Returned by promise. + * @syscap SystemCapability.Multimedia.Media.AVImageGenerator + * @since 20 + * @arkts 1.2 */ - fetchFrameByTime(timeUs: long, options: AVImageQueryOptions, param: PixelMapParams): Promise; + fetchFrameByTime(timeUs: number, options: AVImageQueryOptions, param: PixelMapParams): Promise; /** * Release resources used for AVImageGenerator. @@ -1195,22 +1451,22 @@ declare namespace media { /** * Expected pixelmap's width, -1 means to keep consistent with the * original dimensions of the given video resource. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVImageGenerator * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - width?: int; + width?: number; /** * Expected pixelmap's width, -1 means to keep consistent with the * original dimensions of the given video resource. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVImageGenerator * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - height?: int; + height?: number; /** * Expected pixelmap's color format, see {@link PixelFormat}. @@ -1282,7 +1538,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ enum AVErrorCode { /** @@ -1301,7 +1558,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_OK = 0, @@ -1321,7 +1579,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_NO_PERMISSION = 201, @@ -1341,7 +1600,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_INVALID_PARAMETER = 401, @@ -1361,7 +1621,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_UNSUPPORT_CAPABILITY = 801, @@ -1381,7 +1642,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_NO_MEMORY = 5400101, @@ -1401,7 +1663,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_OPERATE_NOT_PERMIT = 5400102, @@ -1421,7 +1684,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_IO = 5400103, @@ -1441,7 +1705,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_TIMEOUT = 5400104, @@ -1461,7 +1726,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_SERVICE_DIED = 5400105, @@ -1481,7 +1747,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_UNSUPPORT_FORMAT = 5400106, @@ -1496,7 +1763,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_AUDIO_INTERRUPTED = 5400107, /** @@ -1504,7 +1772,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 14 + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_IO_HOST_NOT_FOUND = 5411001, /** @@ -1512,7 +1781,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 14 + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_IO_CONNECTION_TIMEOUT = 5411002, /** @@ -1520,7 +1790,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 14 + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_IO_NETWORK_ABNORMAL = 5411003, /** @@ -1528,7 +1799,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 14 + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_IO_NETWORK_UNAVAILABLE = 5411004, /** @@ -1536,7 +1808,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 14 + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_IO_NO_PERMISSION = 5411005, /** @@ -1544,7 +1817,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 14 + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_IO_REQUEST_DENIED = 5411006, /** @@ -1552,7 +1826,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 14 + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_IO_RESOURCE_NOT_FOUND = 5411007, /** @@ -1561,7 +1836,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 14 + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_IO_SSL_CLIENT_CERT_NEEDED = 5411008, /** @@ -1570,7 +1846,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 14 + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_IO_SSL_CONNECTION_FAILED = 5411009, /** @@ -1578,7 +1855,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 14 + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_IO_SSL_SERVER_CERT_UNTRUSTED = 5411010, /** @@ -1586,14 +1864,16 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 14 + * @since arkts {'1.1':'14','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_IO_UNSUPPORTED_REQUEST = 5411011, /** * Seek continuous unsupported. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_SEEK_CONTINUOUS_UNSUPPORTED = 5410002, @@ -1601,7 +1881,8 @@ declare namespace media { * Super-resolution unsupported. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_SUPER_RESOLUTION_UNSUPPORTED = 5410003, @@ -1609,7 +1890,8 @@ declare namespace media { * No PlaybackStrategy set to enable super-resolution feature. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ AVERR_SUPER_RESOLUTION_NOT_ENABLED = 5410004, } @@ -1643,14 +1925,14 @@ declare namespace media { /** * Define the TrackChange Event callback. * @typedef { function } OnTrackChangeHandler - * @param { int } index - index number for change Track. + * @param { number } index - index number for change Track. * @param { boolean } isSelected - Target index number for moving elements. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - type OnTrackChangeHandler = (index: int, isSelected: boolean) => void; + type OnTrackChangeHandler = (index: number, isSelected: boolean) => void; /** * Defines the OnStateChange callback. @@ -1671,28 +1953,28 @@ declare namespace media { * * @typedef { function } OnBufferingUpdateHandler * @param { BufferingInfoType } infoType - define the Buffering info Type. - * @param { int } value - define the value of buffering info type if exist. + * @param { number } value - define the value of buffering info type if exist. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - type OnBufferingUpdateHandler = (infoType: BufferingInfoType, value: int) => void; + type OnBufferingUpdateHandler = (infoType: BufferingInfoType, value: number) => void; /** * Defines the OnVideoSizeChangeHandler callback. * * @typedef { function } OnVideoSizeChangeHandler - * @param { int } width - Value of video Width. - * @param { int } height - Value of video Height. + * @param { number } width - Value of video Width. + * @param { number } height - Value of video Height. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - type OnVideoSizeChangeHandler = (width: int, height: int) => void; + type OnVideoSizeChangeHandler = (width: number, height: number) => void; /** * Defines the OnSuperResolutionChanged callback. @@ -1718,13 +2000,13 @@ declare namespace media { interface SeiMessage { /** * Payload type of SEI message. - * @type { int } + * @type { number } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ - payloadType: int; + payloadType: number; /** * Payload data of SEI message. @@ -1742,13 +2024,13 @@ declare namespace media { * * @typedef { function } OnSeiMessageHandle * @param { Array } messages - SEI messages. - * @param { ?int } playbackPosition - playback position. + * @param { ?number } playbackPosition - playback position. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ - type OnSeiMessageHandle = (messages: Array, playbackPosition?: int) => void; + type OnSeiMessageHandle = (messages: Array, playbackPosition?: number) => void; /** * Manages and plays media. Before calling an AVPlayer method, you must use createAVPlayer() @@ -2111,14 +2393,14 @@ declare namespace media { /** * Jumps to the specified playback position. - * @param { int } timeMs - Playback position to jump, should be in [0, duration]. + * @param { number } timeMs - Playback position to jump, should be in [0, duration]. * @param { SeekMode } mode - See @SeekMode . * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since 9 */ /** * Jumps to the specified playback position. - * @param { int } timeMs - Playback position to jump, should be in [0, duration]. + * @param { number } timeMs - Playback position to jump, should be in [0, duration]. * @param { SeekMode } mode - See @SeekMode . * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice @@ -2126,7 +2408,7 @@ declare namespace media { */ /** * Jumps to the specified playback position. - * @param { int } timeMs - Playback position to jump, should be in [0, duration]. + * @param { number } timeMs - Playback position to jump, should be in [0, duration]. * @param { SeekMode } mode - See @SeekMode . * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform @@ -2134,24 +2416,24 @@ declare namespace media { * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - seek(timeMs: int, mode?: SeekMode): void; + seek(timeMs: number, mode?: SeekMode): void; /** * Sets the volume. - * @param { double } volume - Relative volume. The value ranges from 0.00 to 1.00. The value 1 indicates the maximum volume (100%). + * @param { number } volume - Relative volume. The value ranges from 0.00 to 1.00. The value 1 indicates the maximum volume (100%). * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since 9 */ /** * Sets the volume. - * @param { double } volume - Relative volume. The value ranges from 0.00 to 1.00. The value 1 indicates the maximum volume (100%). + * @param { number } volume - Relative volume. The value ranges from 0.00 to 1.00. The value 1 indicates the maximum volume (100%). * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - setVolume(volume: double): void; + setVolume(volume: number): void; /** * Get all track infos in MediaDescription, should be called after data loaded callback. @@ -2213,7 +2495,8 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ getSelectedTracks(): Promise>; @@ -2226,7 +2509,8 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ selectTrack(index: number, mode?: SwitchMode): Promise; @@ -2238,7 +2522,8 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ deselectTrack(index: number): Promise; @@ -2252,7 +2537,8 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ setMediaSource(src: MediaSource, strategy?: PlaybackStrategy): Promise; @@ -2269,7 +2555,8 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ addSubtitleFromFd(fd: number, offset?: number, length?: number): Promise; @@ -2282,17 +2569,19 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ addSubtitleFromUrl(url: string): Promise; /** * Get statistic infos of current player. - * @returns { Promise> } Statistic infos of current player. + * @returns { Promise } Statistic infos of current player. * @syscap SystemCapability.Multimedia.Media.AVPlayer - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - getPlaybackInfo(): Promise>; + getPlaybackInfo(): Promise; /** * Set playback strategy to AVPlayer. @@ -2302,7 +2591,8 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ setPlaybackStrategy(strategy: PlaybackStrategy): Promise; @@ -2315,7 +2605,8 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ setMediaMuted(mediaType: MediaType, muted: boolean): Promise; @@ -2335,7 +2626,8 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ setPlaybackRange(startTimeMs: number, endTimeMs: number, mode?: SeekMode) : Promise; @@ -2357,7 +2649,8 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ getPlaybackPosition() : number; @@ -2373,7 +2666,8 @@ declare namespace media { * Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ setSuperResolution(enabled: boolean) : Promise; @@ -2391,7 +2685,8 @@ declare namespace media { * Return by promise. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ setVideoWindowSize(width: number, height: number) : Promise; @@ -2528,7 +2823,8 @@ declare namespace media { * @type { ?audio.AudioEffectMode } * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ audioEffectMode ?: audio.AudioEffectMode; @@ -2539,7 +2835,7 @@ declare namespace media { */ /** * Current playback position. - * @type { int } + * @type { number } * @readonly * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform @@ -2547,7 +2843,7 @@ declare namespace media { * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - readonly currentTime: int; + readonly currentTime: number; /** * Playback duration, When the data source does not support seek, it returns - 1, such as a live broadcast scenario. @@ -2562,7 +2858,7 @@ declare namespace media { */ /** * Playback duration, When the data source does not support seek, it returns - 1, such as a live broadcast scenario. - * @type { int } + * @type { number } * @readonly * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform @@ -2570,7 +2866,7 @@ declare namespace media { * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - readonly duration: int; + readonly duration: number; /** * Playback state. @@ -2618,7 +2914,7 @@ declare namespace media { */ /** * Video width, valid after prepared. - * @type { int } + * @type { number } * @readonly * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform @@ -2626,7 +2922,7 @@ declare namespace media { * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - readonly width: int; + readonly width: number; /** * Video height, valid after prepared. @@ -2635,7 +2931,7 @@ declare namespace media { */ /** * Video height, valid after prepared. - * @type { int } + * @type { number } * @readonly * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform @@ -2643,7 +2939,7 @@ declare namespace media { * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - readonly height: int; + readonly height: number; /** * Video scale type. By default, the {@link #VIDEO_SCALE_TYPE_FIT} will be used, for more @@ -2700,7 +2996,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ setBitrate(bitrate: number): void; @@ -2721,7 +3018,8 @@ declare namespace media { *
2. Incorrect parameter types. 3.Parameter verification failed. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ setDecryptionConfig(mediaKeySession: drm.MediaKeySession, secureVideoPath: boolean): void; @@ -2736,7 +3034,8 @@ declare namespace media { * @returns { Array } MediaKeySystemInfo with PSSH. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ getMediaKeySystemInfos(): Array; @@ -2829,21 +3128,21 @@ declare namespace media { /** * Register listens for media playback volumeChange event. * @param { 'volumeChange' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback volume event. + * @param { Callback } callback - Callback used to listen for the playback volume event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since 9 */ /** * Register listens for media playback volumeChange event. * @param { 'volumeChange' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback volume event. + * @param { Callback } callback - Callback used to listen for the playback volume event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'volumeChange', callback: Callback): void; + on(type: 'volumeChange', callback: Callback): void; /** * Unregister listens for media playback volumeChange event. * @param { 'volumeChange' } type - Type of the playback event to listen for. @@ -2853,13 +3152,13 @@ declare namespace media { /** * Unregister listens for media playback volumeChange event. * @param { 'volumeChange' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback volume event. + * @param { Callback } callback - Callback used to listen for the playback volume event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'volumeChange', callback?: Callback): void; + off(type: 'volumeChange', callback?: Callback): void; /** * Register listens for media playback endOfStream event. * @param { 'endOfStream' } type - Type of the playback event to listen for. @@ -2897,14 +3196,14 @@ declare namespace media { /** * Register listens for media playback seekDone event. * @param { 'seekDone' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback seekDone event. + * @param { Callback } callback - Callback used to listen for the playback seekDone event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since 9 */ /** * Register listens for media playback seekDone event. * @param { 'seekDone' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback seekDone event. + * @param { Callback } callback - Callback used to listen for the playback seekDone event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice * @since 11 @@ -2912,14 +3211,14 @@ declare namespace media { /** * Register listens for media playback seekDone event. * @param { 'seekDone' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback seekDone event. + * @param { Callback } callback - Callback used to listen for the playback seekDone event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'seekDone', callback: Callback): void; + on(type: 'seekDone', callback: Callback): void; /** * Unregister listens for media playback seekDone event. * @param { 'seekDone' } type - Type of the playback event to listen for. @@ -2936,32 +3235,32 @@ declare namespace media { /** * Unregister listens for media playback seekDone event. * @param { 'seekDone' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback seekDone event. + * @param { Callback } callback - Callback used to listen for the playback seekDone event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'seekDone', callback?: Callback): void; + off(type: 'seekDone', callback?: Callback): void; /** * Register listens for media playback speedDone event. * @param { 'speedDone' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback speedDone event. + * @param { Callback } callback - Callback used to listen for the playback speedDone event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since 9 */ /** * Register listens for media playback speedDone event. * @param { 'speedDone' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback speedDone event. + * @param { Callback } callback - Callback used to listen for the playback speedDone event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'speedDone', callback: Callback): void; + on(type: 'speedDone', callback: Callback): void; /** * Unregister listens for media playback speedDone event. * @param { 'speedDone' } type - Type of the playback event to listen for. @@ -2971,30 +3270,30 @@ declare namespace media { /** * Unregister listens for media playback speedDone event. * @param { 'speedDone' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback speedDone event. + * @param { Callback } callback - Callback used to listen for the playback speedDone event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'speedDone', callback?: Callback): void; + off(type: 'speedDone', callback?: Callback): void; /** * Register listens for media playback setBitrateDone event. * @param { 'bitrateDone' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback setBitrateDone event. + * @param { Callback } callback - Callback used to listen for the playback setBitrateDone event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since 9 */ /** * Register listens for media playback setBitrateDone event. * @param { 'bitrateDone' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback setBitrateDone event. + * @param { Callback } callback - Callback used to listen for the playback setBitrateDone event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'bitrateDone', callback: Callback): void; + on(type: 'bitrateDone', callback: Callback): void; /** * Unregister listens for media playback setBitrateDone event. * @param { 'bitrateDone' } type - Type of the playback event to listen for. @@ -3004,23 +3303,23 @@ declare namespace media { /** * Unregister listens for media playback setBitrateDone event. * @param { 'bitrateDone' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback setBitrateDone event. + * @param { Callback } callback - Callback used to listen for the playback setBitrateDone event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'bitrateDone', callback?: Callback): void; + off(type: 'bitrateDone', callback?: Callback): void; /** * Register listens for media playback timeUpdate event. * @param { 'timeUpdate' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback timeUpdate event. + * @param { Callback } callback - Callback used to listen for the playback timeUpdate event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since 9 */ /** * Register listens for media playback timeUpdate event. * @param { 'timeUpdate' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback timeUpdate event. + * @param { Callback } callback - Callback used to listen for the playback timeUpdate event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice * @since 11 @@ -3028,14 +3327,14 @@ declare namespace media { /** * Register listens for media playback timeUpdate event. * @param { 'timeUpdate' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback timeUpdate event. + * @param { Callback } callback - Callback used to listen for the playback timeUpdate event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'timeUpdate', callback: Callback): void; + on(type: 'timeUpdate', callback: Callback): void; /** * Unregister listens for media playback timeUpdate event. * @param { 'timeUpdate' } type - Type of the playback event to listen for. @@ -3052,32 +3351,32 @@ declare namespace media { /** * Unregister listens for media playback timeUpdate event. * @param { 'timeUpdate' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback timeUpdate event. + * @param { Callback } callback - Callback used to listen for the playback timeUpdate event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'timeUpdate', callback?: Callback): void; + off(type: 'timeUpdate', callback?: Callback): void; /** * Register listens for media playback durationUpdate event. * @param { 'durationUpdate' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback durationUpdate event. + * @param { Callback } callback - Callback used to listen for the playback durationUpdate event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since 9 */ /** * Register listens for media playback durationUpdate event. * @param { 'durationUpdate' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback durationUpdate event. + * @param { Callback } callback - Callback used to listen for the playback durationUpdate event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'durationUpdate', callback: Callback): void; + on(type: 'durationUpdate', callback: Callback): void; /** * Unregister listens for media playback durationUpdate event. * @param { 'durationUpdate' } type - Type of the playback event to listen for. @@ -3087,13 +3386,13 @@ declare namespace media { /** * Unregister listens for media playback durationUpdate event. * @param { 'durationUpdate' } type - Type of the playback event to listen for. - * @param { Callback } callback - Callback used to listen for the playback durationUpdate event. + * @param { Callback } callback - Callback used to listen for the playback durationUpdate event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'durationUpdate', callback?: Callback): void; + off(type: 'durationUpdate', callback?: Callback): void; /** * Register listens for video playback buffering events. @@ -3250,14 +3549,14 @@ declare namespace media { * Register listens for available bitrate list collect completed events for HLS protocol stream playback. * This event will be reported after the {@link #prepare} called. * @param { 'availableBitrates' } type - Type of the playback event to listen for. - * @param { Callback> } callback - Callback used to listen for the playback event return available bitrate list. + * @param { Callback> } callback - Callback used to listen for the playback event return available bitrate list. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'availableBitrates', callback: Callback>): void; + on(type: 'availableBitrates', callback: Callback>): void; /** * Unregister listens for available bitrate list collect completed events for HLS protocol stream playback. * This event will be reported after the {@link #prepare} called. @@ -3269,14 +3568,14 @@ declare namespace media { * Unregister listens for available bitrate list collect completed events for HLS protocol stream playback. * This event will be reported after the {@link #prepare} called. * @param { 'availableBitrates' } type - Type of the playback event to listen for. - * @param { Callback> } callback - Callback used to listen for the playback event return available bitrate list. + * @param { Callback> } callback - Callback used to listen for the playback event return available bitrate list. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'availableBitrates', callback?: Callback>): void; + off(type: 'availableBitrates', callback?: Callback>): void; /** * Register listens for playback error events. * @param { 'error' } type - Type of the playback error event to listen for. @@ -3327,8 +3626,37 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice - * @since 12 + * @since 12 + */ + /** + * Register listens for playback error events. + * @param { 'error' } type - Type of the playback error event to listen for. + * @param { ErrorCallback } callback - Callback used to listen for the playback error event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 5400101 - No memory. + * @throws { BusinessError } 5400102 - Operation not allowed. + * @throws { BusinessError } 5400104 - Time out. + * @throws { BusinessError } 5400105 - Service died. + * @throws { BusinessError } 5400106 - Unsupported format. + * @throws { BusinessError } 5411001 - IO can not find host. + * @throws { BusinessError } 5411002 - IO connection timeout. + * @throws { BusinessError } 5411003 - IO network abnormal. + * @throws { BusinessError } 5411004 - IO network unavailable. + * @throws { BusinessError } 5411005 - IO no permission. + * @throws { BusinessError } 5411006 - IO request denied. + * @throws { BusinessError } 5411007 - IO resource not found. + * @throws { BusinessError } 5411008 - IO SSL client cert needed. + * @throws { BusinessError } 5411009 - IO SSL connect fail. + * @throws { BusinessError } 5411010 - IO SSL server cert untrusted. + * @throws { BusinessError } 5411011 - IO unsupported request. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 14 */ + on(type: 'error', callback: ErrorCallback): void; /** * Register listens for playback error events. * @param { 'error' } type - Type of the playback error event to listen for. @@ -3355,9 +3683,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - * @permission + * @since 20 + * @arkts 1.2 */ on(type: 'error', callback: ErrorCallback): void; /** @@ -3373,6 +3700,16 @@ declare namespace media { * @atomicservice * @since 11 */ + /** + * Unregister listens for playback error events. + * @param { 'error' } type - Type of the playback error event to listen for. + * @param { ErrorCallback } callback - Callback used to listen for the playback error event. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 12 + */ + off(type: 'error', callback?: ErrorCallback): void; /** * Unregister listens for playback error events. * @param { 'error' } type - Type of the playback error event to listen for. @@ -3380,8 +3717,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ off(type: 'error', callback?: ErrorCallback): void; @@ -3501,41 +3838,41 @@ declare namespace media { * Subscrips listener for audio playback amplitude update event. * In each event, an array of amplitude is reported, large index indicates closer to current time. * @param { 'amplitudeUpdate' } type - Type of the event to listen for. - * @param { Callback> } callback - Callback used to listen amplitude update event. + * @param { Callback> } callback - Callback used to listen amplitude update event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since arkts {'1.1':'13','1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'amplitudeUpdate', callback: Callback>): void + on(type: 'amplitudeUpdate', callback: Callback>): void /** * UnSubscrips listener for audio playback amplitude update event * @param { 'amplitudeUpdate' } type - Type of the event to listen for. - * @param { Callback> } callback - Callback used to listen amplitude update event. + * @param { Callback> } callback - Callback used to listen amplitude update event. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @since arkts {'1.1':'13','1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'amplitudeUpdate', callback?: Callback>): void + off(type: 'amplitudeUpdate', callback?: Callback>): void /** * Subscribes listener for video SEI message event, only for live video streaming. * Call before the {@link #prepare}, repeated invocation overwrites the last subscribed callback and payload types. * * @param { 'seiMessageReceived' } type - Type of the playback event to listen for. - * @param { Array } payloadTypes - The subscribed payload types of the SEI message. + * @param { Array } payloadTypes - The subscribed payload types of the SEI message. * @param { OnSeiMessageHandle } callback - Callback to listen SEI message event with subscribed payload types. * @syscap SystemCapability.Multimedia.Media.AVPlayer * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'seiMessageReceived', payloadTypes: Array, callback: OnSeiMessageHandle): void; + on(type: 'seiMessageReceived', payloadTypes: Array, callback: OnSeiMessageHandle): void; /** * Unsubscribes listener for video SEI message event. * @param { 'seiMessageReceived' } type - Type of the playback event to listen for. - * @param { Array } payloadTypes - The payload types of the SEI message. + * @param { Array } payloadTypes - The payload types of the SEI message. * Null means unsubscribe all payload types. * @param { OnSeiMessageHandle } callback - Callback to listen SEI message event with subscribed payload types. @@ -3544,7 +3881,7 @@ declare namespace media { * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'seiMessageReceived', payloadTypes?: Array, callback?: OnSeiMessageHandle): void; + off(type: 'seiMessageReceived', payloadTypes?: Array, callback?: OnSeiMessageHandle): void; /** * Subscribes listener for super-resolution status changed event. @@ -3600,41 +3937,47 @@ declare namespace media { * * @enum { string } * @syscap SystemCapability.Multimedia.Media.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ enum PlaybackInfoKey { /** * IP address of current network stream. * @syscap SystemCapability.Multimedia.Media.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ SERVER_IP_ADDRESS = 'server_ip_address', /** * Average download rate during playing except for suspend downloading. * @syscap SystemCapability.Multimedia.Media.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ AVG_DOWNLOAD_RATE = 'average_download_rate', /** * Current download rate of the last second except for suspend downloading. * @syscap SystemCapability.Multimedia.Media.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ DOWNLOAD_RATE = 'download_rate', /** * Boolean value, true for current is downloading, false for suspend downloading. * @syscap SystemCapability.Multimedia.Media.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ IS_DOWNLOADING = 'is_downloading', /** * Cached duration in milliseconds. * @syscap SystemCapability.Multimedia.Media.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ BUFFER_DURATION = 'buffer_duration', } @@ -3829,7 +4172,8 @@ declare namespace media { * - client should return immediately. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ type SourceOpenCallback = (request: MediaSourceLoadingRequest) => number; @@ -3845,7 +4189,8 @@ declare namespace media { * @returns { void } - client should return immediately. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ type SourceReadCallback = (uuid: number, requestedOffset: number, requestedLength: number) => void; @@ -3856,7 +4201,8 @@ declare namespace media { * @returns { void } - client should return immediately. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ type SourceCloseCallback = (uuid: number) => void; @@ -3865,7 +4211,8 @@ declare namespace media { * @typedef MediaSourceLoader * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ interface MediaSourceLoader { /** @@ -3873,7 +4220,8 @@ declare namespace media { * @type { SourceOpenCallback } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ open: SourceOpenCallback; @@ -3882,7 +4230,8 @@ declare namespace media { * @type { SourceReadCallback } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ read: SourceReadCallback; @@ -3891,7 +4240,8 @@ declare namespace media { * @type { SourceCloseCallback } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ close: SourceCloseCallback; } @@ -3901,14 +4251,16 @@ declare namespace media { * @enum { number } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ enum LoadingRequestError { /** * If reach the resource end, client should return. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ LOADING_ERROR_SUCCESS = 0, @@ -3916,7 +4268,8 @@ declare namespace media { * If resource not ready for access, client should return. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ LOADING_ERROR_NOT_READY = 1, @@ -3924,7 +4277,8 @@ declare namespace media { * If resource url not exist, client should return. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ LOADING_ERROR_NO_RESOURCE = 2, @@ -3932,7 +4286,8 @@ declare namespace media { * If the uuid of resource handle is valid, client should return. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ LOADING_ERROR_INVAID_HANDLE = 3, @@ -3940,7 +4295,8 @@ declare namespace media { * If client has no right to request the resource, client should return. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ LOADING_ERROR_ACCESS_DENIED = 4, @@ -3948,7 +4304,8 @@ declare namespace media { * If access time out, client should return. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ LOADING_ERROR_ACCESS_TIMEOUT = 5, @@ -3956,7 +4313,8 @@ declare namespace media { * If authorization failed, client should return. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ LOADING_ERROR_AUTHORIZE_FAILED = 6, } @@ -3986,7 +4344,8 @@ declare namespace media { * @type { ?Record } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ header?: Record; @@ -3995,14 +4354,28 @@ declare namespace media { * @param { number } uuid - label the resource handle. * @param { number } offset - current media data position from start of the source. * @param { ArrayBuffer } buffer - media data buffer which respond to the player. - * @returns { int } - accept bytes for current read. The value less than zero means failed. + * @returns { number } - accept bytes for current read. The value less than zero means failed. * - 2, means player need current data any more, the client should stop current read process. * - 3, means player buffer is full, the client should wait for next read. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice * @since 18 */ - respondData(uuid: number, offset: number, buffer: ArrayBuffer): int; + respondData(uuid: number, offset: number, buffer: ArrayBuffer): number; + /** + * The interface for application used to send requested data to AVPlayer. + * @param { number } uuid - label the resource handle. + * @param { number } offset - current media data position from start of the source. + * @param { ArrayBuffer } buffer - media data buffer which respond to the player. + * @returns { number | undefined } - accept bytes for current read. The value less than zero means failed. + * - 2, means player need current data any more, the client should stop current read process. + * - 3, means player buffer is full, the client should wait for next read. + * @syscap SystemCapability.Multimedia.Media.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + respondData(uuid: number, offset: number, buffer: ArrayBuffer): number | undefined; /** * The interface for application used to send respond header to AVPlayer @@ -4012,7 +4385,8 @@ declare namespace media { * @param { ?string } [redirectUrl] - redirect url from the http response if exist. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ respondHeader(uuid: number, header?: Record, redirectUrl?: string): void; @@ -4022,7 +4396,8 @@ declare namespace media { * @param { LoadingRequestError } state - the request state. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ finishLoading(uuid: number, state: LoadingRequestError): void; } @@ -4048,33 +4423,33 @@ declare namespace media { /** * video width. - * @type { long } + * @type { number } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ - width: long; + width: number; /** * video height. - * @type { long } + * @type { number } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ - height: long; + height: number; /** * biterate of this mediaStream. - * @type { long } + * @type { number } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ - bitrate: long; + bitrate: number; } /** @@ -4083,7 +4458,8 @@ declare namespace media { * @typedef MediaSource * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ interface MediaSource { /** @@ -4091,7 +4467,8 @@ declare namespace media { * @param { AVMimeTypes } mimeType - for MediaSource define. see @ AVMimeTypes. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ setMimeType(mimeType: AVMimeTypes): void; @@ -4100,7 +4477,8 @@ declare namespace media { * @param { MediaSourceLoader } resourceLoader - callback function interface set for player use. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ setMediaResourceLoaderDelegate(resourceLoader: MediaSourceLoader): void; } @@ -4110,14 +4488,16 @@ declare namespace media { * @enum { string } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ enum AVMimeTypes { /** * Indicate current file is index file for hls Media. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ APPLICATION_M3U8 = 'application/m3u8', } @@ -4127,7 +4507,8 @@ declare namespace media { * @typedef PlaybackStrategy * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ interface PlaybackStrategy { /** @@ -4135,7 +4516,8 @@ declare namespace media { * @type { ?number } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ preferredWidth?: number; /** @@ -4143,7 +4525,8 @@ declare namespace media { * @type { ?number } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ preferredHeight?: number; /** @@ -4151,7 +4534,8 @@ declare namespace media { * @type { ?number } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ preferredBufferDuration?: number; @@ -4160,7 +4544,8 @@ declare namespace media { * @type { ?boolean } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ preferredHdr?: boolean; @@ -4168,7 +4553,8 @@ declare namespace media { * mute the specified media stream when playing. * @type { ?MediaType } * @syscap SystemCapability.Multimedia.Media.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ mutedMediaType?: MediaType; @@ -4177,7 +4563,8 @@ declare namespace media { * @type { ?string } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 13 + * @since arkts {'1.1':'13','1.2':'20'} + * @arkts 1.1&1.2 */ preferredAudioLanguage?: string; @@ -4186,7 +4573,8 @@ declare namespace media { * @type { ?string } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 13 + * @since arkts {'1.1':'13','1.2':'20'} + * @arkts 1.1&1.2 */ preferredSubtitleLanguage?: string; @@ -4195,7 +4583,8 @@ declare namespace media { * @type { ?boolean } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ showFirstFrameOnPrepare?: boolean; @@ -4204,7 +4593,8 @@ declare namespace media { * @type { ?number } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ preferredBufferDurationForPlaying?: number; @@ -4214,7 +4604,8 @@ declare namespace media { * @type { ?boolean } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ enableSuperResolution?: boolean; @@ -4224,7 +4615,8 @@ declare namespace media { * @type { ?number } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ thresholdForAutoQuickPlay?: number } @@ -4274,14 +4666,14 @@ declare namespace media { /** * The file descriptor of audio or video source from file system. The caller * is responsible to close the file descriptor. - * @type { int } + * @type { number } * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - fd: int + fd: number /** * The offset into the file where the data to be read, in bytes. By default, @@ -4299,14 +4691,14 @@ declare namespace media { /** * The offset into the file where the data to be read, in bytes. By default, * the offset is zero. - * @type { ?long } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - offset?: long + offset?: number /** * The length in bytes of the data to be read. By default, the length is the @@ -4324,14 +4716,14 @@ declare namespace media { /** * The length in bytes of the data to be read. By default, the length is the * rest of bytes in the file from the offset. - * @type { ?long } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - length?: long + length?: number } /** @@ -4379,14 +4771,14 @@ declare namespace media { /** * Size of the file, -1 means the file size is unknown, in this case, * seek and setSpeed can't be executed, loop can't be set, and can't replay. - * @type { long } + * @type { number } * @syscap SystemCapability.Multimedia.Media.AVPlayer * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - fileSize: long; + fileSize: number; /** * Callback function implemented by users, which is used to fill data. * buffer - The buffer need to fill. @@ -4423,7 +4815,7 @@ declare namespace media { * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - callback: (buffer: ArrayBuffer, length: long, pos?: long) => int; + callback: (buffer: ArrayBuffer, length: number, pos?: number) => number; } /** @@ -4439,22 +4831,22 @@ declare namespace media { interface SubtitleInfo { /** * Duration of the text to be displayed, as milliseconds. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - duration?: int; + duration?: number; /** * Display start time of the text, as milliseconds. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - startTime?: int; + startTime?: number; /** * Text information of current update event. * @type { ?string } @@ -4694,13 +5086,13 @@ declare namespace media { /** * Listens for playback error events. * @param { 'error' } type - Type of the playback error event to listen for. - * @param { ErrorCallback } callback - Callback used to listen for the playback error event. + * @param { ErrorCallback } callback - Callback used to listen for the playback error event. * @syscap SystemCapability.Multimedia.Media.AudioPlayer * @since 6 * @deprecated since 9 * @useinstead ohos.multimedia.media/media.AVPlayer#event:error */ - on(type: 'error', callback: ErrorCallback): void; + on(type: 'error', callback: ErrorCallback): void; } /** @@ -4824,6 +5216,17 @@ declare namespace media { * @since 11 */ getAVRecorderConfig(callback: AsyncCallback): void; + /** + * Get AVRecorderConfig.it must be called after prepare. + * @param { AsyncCallback } callback - Callback used to return the input config in AVRecorderConfig. + * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. + * @throws { BusinessError } 5400103 - IO error. Return by callback. + * @throws { BusinessError } 5400105 - Service died. Return by callback. + * @syscap SystemCapability.Multimedia.Media.AVRecorder + * @since 20 + * @arkts 1.2 + */ + getAVRecorderConfig(callback: AsyncCallback): void; /** * Get AVRecorderConfig.it must be called after prepare. @@ -4835,6 +5238,17 @@ declare namespace media { * @since 11 */ getAVRecorderConfig(): Promise; + /** + * Get AVRecorderConfig.it must be called after prepare. + * @returns { Promise } A Promise instance used to return the input config in AVRecorderConfig. + * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. + * @throws { BusinessError } 5400103 - IO error. Return by promise. + * @throws { BusinessError } 5400105 - Service died. Return by promise. + * @syscap SystemCapability.Multimedia.Media.AVRecorder + * @since 20 + * @arkts 1.2 + */ + getAVRecorderConfig(): Promise; /** * Get input surface.it must be called between prepare completed and start. @@ -4843,10 +5257,20 @@ declare namespace media { * @throws { BusinessError } 5400103 - IO error. Return by callback. * @throws { BusinessError } 5400105 - Service died. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVRecorder - * @since arkts {'1.1':'9','1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ getInputSurface(callback: AsyncCallback): void; + /** + * Get input surface.it must be called between prepare completed and start. + * @param { AsyncCallback } callback - Callback used to return the input surface id in string. + * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. + * @throws { BusinessError } 5400103 - IO error. Return by callback. + * @throws { BusinessError } 5400105 - Service died. Return by callback. + * @syscap SystemCapability.Multimedia.Media.AVRecorder + * @since 20 + * @arkts 1.2 + */ + getInputSurface(callback: AsyncCallback): void; /** * Get input surface. it must be called between prepare completed and start. @@ -4855,10 +5279,20 @@ declare namespace media { * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVRecorder - * @since arkts {'1.1':'9','1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ getInputSurface(): Promise; + /** + * Get input surface. it must be called between prepare completed and start. + * @returns { Promise } A Promise instance used to return the input surface id in string. + * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. + * @throws { BusinessError } 5400103 - IO error. Return by promise. + * @throws { BusinessError } 5400105 - Service died. Return by promise. + * @syscap SystemCapability.Multimedia.Media.AVRecorder + * @since 20 + * @arkts 1.2 + */ + getInputSurface(): Promise; /** * Get input meta surface for specified meta source type. it must be called between prepare completed and start. @@ -4875,13 +5309,30 @@ declare namespace media { * @since 12 */ getInputMetaSurface(type: MetaSourceType): Promise; + /** + * Get input meta surface for specified meta source type. it must be called between prepare completed and start. + * @param { MetaSourceType } type - Meta source type. + * @returns { Promise } A Promise instance used to return the input surface id in string. + * @throws { BusinessError } 202 - Called from Non-System applications. Return by promise. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3.Parameter verification failed. + * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. + * @throws { BusinessError } 5400103 - IO error. Return by promise. + * @throws { BusinessError } 5400105 - Service died. Return by promise. + * @syscap SystemCapability.Multimedia.Media.AVRecorder + * @systemapi + * @since 20 + * @arkts 1.2 + */ + getInputMetaSurface(type: MetaSourceType): Promise; /** * Check if the avrecorder has watermark capability. * @returns { Promise } A Promise instance used to return true or false when the function is finished. * @syscap SystemCapability.Multimedia.Media.AVRecorder * @systemapi - * @since 13 + * @since arkts {'1.1':'13','1.2':'20'} + * @arkts 1.1&1.2 */ isWatermarkSupported(): Promise; /** @@ -4893,7 +5344,8 @@ declare namespace media { * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.Multimedia.Media.AVRecorder * @systemapi - * @since 13 + * @since arkts {'1.1':'13','1.2':'20'} + * @arkts 1.1&1.2 */ setWatermark(watermark: image.PixelMap, config: WatermarkConfig): Promise /** @@ -4906,7 +5358,8 @@ declare namespace media { * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVRecorder - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ updateRotation(rotation: number): Promise; @@ -4927,7 +5380,8 @@ declare namespace media { * @throws { BusinessError } 5400105 - Service died. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ start(callback: AsyncCallback): void; @@ -4949,7 +5403,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ start(): Promise; @@ -5015,7 +5470,8 @@ declare namespace media { * @throws { BusinessError } 5400105 - Service died. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ resume(callback: AsyncCallback): void; @@ -5037,7 +5493,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ resume(): Promise; @@ -5173,6 +5630,17 @@ declare namespace media { * @since 11 */ getCurrentAudioCapturerInfo(callback: AsyncCallback): void; + /** + * Get AudioCapturer info from current AVRecorder. + * @param { AsyncCallback } callback - A callback used to return AudioCapturerChangeInfo. + * @throws { BusinessError } 5400102 - Operation not allowed. + * @throws { BusinessError } 5400103 - I/O error. + * @throws { BusinessError } 5400105 - Service died. Return by callback. + * @syscap SystemCapability.Multimedia.Media.AVRecorder + * @since 20 + * @arkts 1.2 + */ + getCurrentAudioCapturerInfo(callback: AsyncCallback): void; /** * Get AudioCapturer info from current AVRecorder. @@ -5184,6 +5652,17 @@ declare namespace media { * @since 11 */ getCurrentAudioCapturerInfo(): Promise; + /** + * Get AudioCapturer info from current AVRecorder. + * @returns { Promise } A Promise instance used to return AudioCapturerChangeInfo. + * @throws { BusinessError } 5400102 - Operation not allowed. + * @throws { BusinessError } 5400103 - I/O error. + * @throws { BusinessError } 5400105 - Service died. Return by promise. + * @syscap SystemCapability.Multimedia.Media.AVRecorder + * @since 20 + * @arkts 1.2 + */ + getCurrentAudioCapturerInfo(): Promise; /** * Get max audio capturer amplitude from current AVRecorder. @@ -5191,7 +5670,8 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. * @throws { BusinessError } 5400105 - Service died. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVRecorder - * @since 11 + * @since arkts {'1.1':'11','1.2':'20'} + * @arkts 1.1&1.2 */ getAudioCapturerMaxAmplitude(callback: AsyncCallback): void; @@ -5201,7 +5681,8 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVRecorder - * @since 11 + * @since arkts {'1.1':'11','1.2':'20'} + * @arkts 1.1&1.2 */ getAudioCapturerMaxAmplitude(): Promise; @@ -5211,7 +5692,8 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. * @throws { BusinessError } 5400105 - Service died. Return by callback. * @syscap SystemCapability.Multimedia.Media.AVRecorder - * @since 11 + * @since arkts {'1.1':'11','1.2':'20'} + * @arkts 1.1&1.2 */ getAvailableEncoder(callback: AsyncCallback>): void; @@ -5221,7 +5703,8 @@ declare namespace media { * @throws { BusinessError } 5400102 - Operation not allowed. * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVRecorder - * @since 11 + * @since arkts {'1.1':'11','1.2':'20'} + * @arkts 1.1&1.2 */ getAvailableEncoder(): Promise>; @@ -5321,6 +5804,27 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.AVRecorder * @since 11 */ + /** + * Listens for recording error events. + * @param { 'error' } type - Type of the recording error event to listen for. + * @param { ErrorCallback } callback - Callback used to listen for the recorder error event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3.Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 5400101 - No memory. + * @throws { BusinessError } 5400102 - Operation not allowed. + * @throws { BusinessError } 5400103 - I/O error. + * @throws { BusinessError } 5400104 - Time out. + * @throws { BusinessError } 5400105 - Service died. + * @throws { BusinessError } 5400106 - Unsupported format. + * @throws { BusinessError } 5400107 - Audio interrupted. + * @syscap SystemCapability.Multimedia.Media.AVRecorder + * @crossplatform + * @atomicservice + * @since 12 + */ + on(type: 'error', callback: ErrorCallback): void; /** * Listens for recording error events. * @param { 'error' } type - Type of the recording error event to listen for. @@ -5339,9 +5843,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - * @permission + * @since 20 + * @arkts 1.2 */ on(type: 'error', callback: ErrorCallback): void; @@ -5369,6 +5872,16 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.AVRecorder * @since 9 */ + /** + * Cancel Listens for recording error events. + * @param { 'error' } type - Type of the recording error event to listen for. + * @param { ErrorCallback } callback - Callback used to listen for the recorder error event. + * @syscap SystemCapability.Multimedia.Media.AVRecorder + * @crossplatform + * @atomicservice + * @since 12 + */ + off(type: 'error', callback?: ErrorCallback): void; /** * Cancel Listens for recording error events. * @param { 'error' } type - Type of the recording error event to listen for. @@ -5376,8 +5889,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ off(type: 'error', callback?: ErrorCallback): void; @@ -5534,13 +6047,13 @@ declare namespace media { */ /** * Latitude. - * @type { double } + * @type { number } * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - latitude: double; + latitude: number; /** * Longitude. @@ -5549,13 +6062,13 @@ declare namespace media { */ /** * Longitude. - * @type { double } + * @type { number } * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - longitude: double; + longitude: number; } /** * Set configures of a watermark to AVRecorder. The position starts at top left corner. @@ -5563,7 +6076,8 @@ declare namespace media { * @typedef WatermarkConfig * @syscap SystemCapability.Multimedia.Media.Core * @systemapi - * @since 13 + * @since arkts {'1.1':'13','1.2':'20'} + * @arkts 1.1&1.2 */ interface WatermarkConfig { /** @@ -5571,7 +6085,8 @@ declare namespace media { * @type { number } * @syscap SystemCapability.Multimedia.Media.Core * @systemapi - * @since 13 + * @since arkts {'1.1':'13','1.2':'20'} + * @arkts 1.1&1.2 */ top: number; /** @@ -5579,7 +6094,8 @@ declare namespace media { * @type { number } * @syscap SystemCapability.Multimedia.Media.Core * @systemapi - * @since 13 + * @since arkts {'1.1':'13','1.2':'20'} + * @arkts 1.1&1.2 */ left: number; } @@ -5708,7 +6224,7 @@ declare namespace media { * @param { AudioRecorderConfig } config - Recording parameters. * @throws { BusinessError } 201 - permission denied. * @syscap SystemCapability.Multimedia.Media.AudioRecorder - * @since 6 + * @since 12 * @deprecated since 9 * @useinstead ohos.multimedia.media/media.AVRecorder#prepare */ @@ -5784,13 +6300,13 @@ declare namespace media { /** * Listens for audio recording error events. * @param { 'error' } type - Type of the audio recording error event to listen for. - * @param { ErrorCallback } callback - Callback used to listen for the audio recording error event. + * @param { ErrorCallback } callback - Callback used to listen for the audio recording error event. * @syscap SystemCapability.Multimedia.Media.AudioRecorder * @since 6 * @deprecated since 9 * @useinstead ohos.multimedia.media/media.AVRecorder#on */ - on(type: 'error', callback: ErrorCallback): void; + on(type: 'error', callback: ErrorCallback): void; } /** @@ -5898,10 +6414,22 @@ declare namespace media { * @throws { BusinessError } 5400105 - Service died. Return by callback. * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getInputSurface(callback: AsyncCallback): void; + /** + * get input surface.it must be called between prepare completed and start. + * @param { AsyncCallback } callback - Callback used to return the input surface id in string. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. + * @throws { BusinessError } 5400103 - I/O error. Return by callback. + * @throws { BusinessError } 5400105 - Service died. Return by callback. + * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi + * @since 20 + * @arkts 1.2 + */ + getInputSurface(callback: AsyncCallback): void; /** * get input surface. it must be called between prepare completed and start. * @returns { Promise } A Promise instance used to return the input surface id in string. @@ -5921,10 +6449,22 @@ declare namespace media { * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getInputSurface(): Promise; + /** + * get input surface. it must be called between prepare completed and start. + * @returns { Promise } A Promise instance used to return the input surface id in string. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. + * @throws { BusinessError } 5400103 - I/O error. Return by promise. + * @throws { BusinessError } 5400105 - Service died. Return by promise. + * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi + * @since 20 + * @arkts 1.2 + */ + getInputSurface(): Promise; /** * Starts video recording. * @param { AsyncCallback } callback - A callback instance used to return when start completed. @@ -5944,7 +6484,8 @@ declare namespace media { * @throws { BusinessError } 5400105 - Service died. Return by callback. * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ start(callback: AsyncCallback): void; /** @@ -5966,7 +6507,8 @@ declare namespace media { * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ start(): Promise; /** @@ -6034,7 +6576,8 @@ declare namespace media { * @throws { BusinessError } 5400105 - Service died. Return by callback. * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ resume(callback: AsyncCallback): void; /** @@ -6056,7 +6599,8 @@ declare namespace media { * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ resume(): Promise; /** @@ -6205,7 +6749,6 @@ declare namespace media { */ /** * Listens for video recording error events. - * @permission * @param { 'error' } type - Type of the video recording error event to listen for. * @param { ErrorCallback } callback - Callback used to listen for the video recording error event. * @throws { BusinessError } 201 - permission denied. @@ -6217,6 +6760,20 @@ declare namespace media { * @since 12 */ on(type: 'error', callback: ErrorCallback): void; + /** + * Listens for video recording error events. + * @param { 'error' } type - Type of the video recording error event to listen for. + * @param { ErrorCallback } callback - Callback used to listen for the video recording error event. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 5400103 - I/O error. Return by callback. + * @throws { BusinessError } 5400105 - Service died. Return by callback. + * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi + * @since 20 + * @arkts 1.2 + */ + on(type: 'error', callback: ErrorCallback): void; /** * video recorder state. @@ -6769,13 +7326,13 @@ declare namespace media { /** * Listens for playback error events. * @param { 'error' } type - Type of the playback error event to listen for. - * @param { ErrorCallback } callback - Callback used to listen for the playback error event. + * @param { ErrorCallback } callback - Callback used to listen for the playback error event. * @syscap SystemCapability.Multimedia.Media.VideoPlayer * @since 8 * @deprecated since 9 * @useinstead ohos.multimedia.media/media.AVPlayer#event:error */ - on(type: 'error', callback: ErrorCallback): void; + on(type: 'error', callback: ErrorCallback): void; } /** @@ -7266,25 +7823,25 @@ declare namespace media { interface VideoRecorderProfile { /** * Indicates the audio bit rate. - * @type { int } + * @type { number } * @readonly * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi * @since arkts {'1.1':'9','1.2':'20'} * @arkts 1.1&1.2 */ - readonly audioBitrate: int; + readonly audioBitrate: number; /** * Indicates the number of audio channels. - * @type { int } + * @type { number } * @readonly * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi * @since arkts {'1.1':'9','1.2':'20'} * @arkts 1.1&1.2 */ - readonly audioChannels: int; + readonly audioChannels: number; /** * Indicates the audio encoding format. @@ -7299,14 +7856,14 @@ declare namespace media { /** * Indicates the audio sampling rate. - * @type { int } + * @type { number } * @readonly * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi * @since arkts {'1.1':'9','1.2':'20'} * @arkts 1.1&1.2 */ - readonly audioSampleRate: int; + readonly audioSampleRate: number; /** * Indicates the output file format. @@ -7321,14 +7878,14 @@ declare namespace media { /** * Indicates the video bit rate. - * @type { int } + * @type { number } * @readonly * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi * @since arkts {'1.1':'9','1.2':'20'} * @arkts 1.1&1.2 */ - readonly videoBitrate: int; + readonly videoBitrate: number; /** * Indicates the video encoding format. @@ -7343,36 +7900,36 @@ declare namespace media { /** * Indicates the video width. - * @type { int } + * @type { number } * @readonly * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi * @since arkts {'1.1':'9','1.2':'20'} * @arkts 1.1&1.2 */ - readonly videoFrameWidth: int; + readonly videoFrameWidth: number; /** * Indicates the video height. - * @type { int } + * @type { number } * @readonly * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi * @since arkts {'1.1':'9','1.2':'20'} * @arkts 1.1&1.2 */ - readonly videoFrameHeight: int; + readonly videoFrameHeight: number; /** * Indicates the video frame rate. - * @type { int } + * @type { number } * @readonly * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi * @since arkts {'1.1':'9','1.2':'20'} * @arkts 1.1&1.2 */ - readonly videoFrameRate: int; + readonly videoFrameRate: number; } /** @@ -7592,13 +8149,13 @@ declare namespace media { /** * Sets the video rotation angle in output file, and for the file to playback. mp4 support. * the range of rotation angle should be {0, 90, 180, 270}, default is 0. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @systemapi * @since arkts {'1.1':'9','1.2':'20'} * @arkts 1.1&1.2 */ - rotation?: int; + rotation?: number; /** * geographical location information. * @type { ?Location } @@ -7684,12 +8241,12 @@ declare namespace media { /** * audio encoder sample rate collection - * @type { ?Array } + * @type { ?Array } * @syscap SystemCapability.Multimedia.Media.AVRecorder * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ - sampleRate?: Array; + sampleRate?: Array; } /** @@ -7703,21 +8260,21 @@ declare namespace media { interface Range { /** * lower limit of the range - * @type { int } + * @type { number } * @syscap SystemCapability.Multimedia.Media.AVRecorder * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ - min: int; + min: number; /** * upper limit of the range - * @type { int } + * @type { number } * @syscap SystemCapability.Multimedia.Media.AVRecorder * @since arkts {'1.1':'11','1.2':'20'} * @arkts 1.1&1.2 */ - max: int; + max: number; } /** @@ -7745,14 +8302,14 @@ declare namespace media { */ /** * Indicates the audio bitrate. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - audioBitrate?: int; + audioBitrate?: number; /** * Indicates the number of audio channels. @@ -7761,14 +8318,14 @@ declare namespace media { */ /** * Indicates the number of audio channels. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - audioChannels?: int; + audioChannels?: number; /** * Indicates the audio encoding format. @@ -7793,14 +8350,14 @@ declare namespace media { */ /** * Indicates the audio sampling rate. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform * @atomicservice * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - audioSampleRate?: int; + audioSampleRate?: number; /** * Indicates the output file format. @@ -7825,13 +8382,13 @@ declare namespace media { */ /** * Indicates the video bitrate. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - videoBitrate?: int; + videoBitrate?: number; /** * Indicates the video encoding format. @@ -7855,13 +8412,13 @@ declare namespace media { */ /** * Indicates the video width. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - videoFrameWidth?: int; + videoFrameWidth?: number; /** * Indicates the video height. @@ -7870,13 +8427,13 @@ declare namespace media { */ /** * Indicates the video height. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - videoFrameHeight?: int; + videoFrameHeight?: number; /** * Indicates the video frame rate. @@ -7885,13 +8442,13 @@ declare namespace media { */ /** * Indicates the video frame rate. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVRecorder * @crossplatform * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - videoFrameRate?: int; + videoFrameRate?: number; /** * Whether to record HDR video. @@ -7924,7 +8481,7 @@ declare namespace media { * @type { ?boolean } * @syscap SystemCapability.Multimedia.Media.AVRecorder * @systemapi - * @since arkts {'1.1':'12','1.2':'20'} + * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ enableStableQualityMode?: boolean @@ -8032,26 +8589,25 @@ declare namespace media { * Mode of creating recorder file, details see @FileGenerationMode. * @type { ?FileGenerationMode } * @syscap SystemCapability.Multimedia.Media.AVRecorder - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ fileGenerationMode?: FileGenerationMode; /** * Sets the video rotation angle in output file, and for the file to playback, mp4 support * the range of rotation angle should be {0, 90, 180, 270}, default is 0. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVRecorder - * @since arkts {'1.1':'9','1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 * @deprecated since 12 * @useinstead ohos.multimedia.media/media.AVMetadata#videoOrientation */ - rotation?: int; + rotation?: number; /** * Geographical location information. * @type { ?Location } * @syscap SystemCapability.Multimedia.Media.AVRecorder - * @since arkts {'1.1':'9','1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 * @deprecated since 12 * @useinstead ohos.multimedia.media/media.AVMetadata#location */ @@ -8060,16 +8616,18 @@ declare namespace media { * Set global metadata info. Details see @AVMetadata * @type { ?AVMetadata } * @syscap SystemCapability.Multimedia.Media.AVRecorder - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ metadata?: AVMetadata; /** * Set the longest duration allowed for current recording. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVRecorder - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ - maxDuration?: int; + maxDuration?: number; } /** @@ -8226,7 +8784,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ enum SwitchMode { /** @@ -8234,7 +8793,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ SMOOTH = 0, /** @@ -8242,14 +8802,16 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ SEGMENT = 1, /** * switch to the closest frame of the given timestamp. * @syscap SystemCapability.Multimedia.Media.Core * @atomicservice - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ CLOSEST = 2, } @@ -8430,19 +8992,22 @@ declare namespace media { * * @enum { number } * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ enum AVScreenCaptureRecordPreset { /** * Screen record normal type, h264/aac mp4 * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ SCREEN_RECORD_PRESET_H264_AAC_MP4 = 0, /** * Screen record high efficient type, h265/aac mp4 * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ SCREEN_RECORD_PRESET_H265_AAC_MP4 = 1, } @@ -8452,19 +9017,22 @@ declare namespace media { * * @enum { number } * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ enum AVScreenCaptureFillMode { /** * Keep the scale the same as that of the original image * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ PRESERVE_ASPECT_RATIO = 0, /** * Fit the configured width and height * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ SCALE_TO_FILL = 1, } @@ -8568,80 +9136,82 @@ declare namespace media { interface AVScreenCaptureRecordConfig { /** * Indicates record file descriptor. - * @type { int } + * @type { number } * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - fd: int; + fd: number; /** * Indicates video frame width. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - frameWidth?: int; + frameWidth?: number; /** * Indicates video frame height. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - frameHeight?: int; + frameHeight?: number; /** * Indicates video bitrate. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - videoBitrate?: int; + videoBitrate?: number; /** * Indicates audio sample rate. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - audioSampleRate?: int; + audioSampleRate?: number; /** * Indicates audio channel count. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - audioChannelCount?: int; + audioChannelCount?: number; /** * Indicates audio bitrate. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - audioBitrate?: int; + audioBitrate?: number; /** * Indicates AVScreenCaptureRecordPreset, details see @AVScreenCaptureRecordPreset * @type { ?AVScreenCaptureRecordPreset } * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ preset?: AVScreenCaptureRecordPreset; /** * Indicates the screen to be recorded. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @since arkts {'1.1':'15','1.2':'20'} * @arkts 1.1&1.2 */ - displayId?: int; + displayId?: number; /** * Indicates the fill mode of video, details see @AVScreenCaptureFillMode * @type { ?AVScreenCaptureFillMode } * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since 18 + * @since arkts {'1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ fillMode?: AVScreenCaptureFillMode; } @@ -8665,7 +9235,8 @@ declare namespace media { * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ init(config: AVScreenCaptureRecordConfig): Promise; @@ -8675,7 +9246,8 @@ declare namespace media { * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ startRecording(): Promise; @@ -8685,7 +9257,8 @@ declare namespace media { * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ stopRecording(): Promise; @@ -8696,7 +9269,8 @@ declare namespace media { * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ skipPrivacyMode(windowIDs: Array): Promise; @@ -8707,7 +9281,8 @@ declare namespace media { * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ setMicEnabled(enable: boolean): Promise; @@ -8732,6 +9307,17 @@ declare namespace media { */ on(type: 'stateChange', callback: Callback): void; + /** + * Listens for AVScreenCaptureRecord info callback. + * @param { 'error' } type - Type of the AVScreenCaptureRecord event to listen for. + * @param { ErrorCallback } callback - Callback used to listen for the AVScreenCaptureRecord error return. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 5400103 - IO error. Return by ErrorCallback. + * @throws { BusinessError } 5400105 - Service died. Return by ErrorCallback. + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @since 12 + */ + on(type: 'error', callback: ErrorCallback): void; /** * Listens for AVScreenCaptureRecord info callback. * @param { 'error' } type - Type of the AVScreenCaptureRecord event to listen for. @@ -8740,9 +9326,8 @@ declare namespace media { * @throws { BusinessError } 5400103 - IO error. Return by ErrorCallback. * @throws { BusinessError } 5400105 - Service died. Return by ErrorCallback. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - * @permission + * @since 20 + * @arkts 1.2 */ on(type: 'error', callback: ErrorCallback): void; @@ -8756,13 +9341,21 @@ declare namespace media { */ off(type: 'stateChange', callback?: Callback): void; + /** + * Unregister listens for AVScreenCaptureRecord error callback. + * @param { 'error' } type - Type of the AVScreenCaptureRecord event to listen for. + * @param { ErrorCallback } callback - Callback used to listen for the AVScreenCaptureRecord error return. + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @since 12 + */ + off(type: 'error', callback?: ErrorCallback): void; /** * Unregister listens for AVScreenCaptureRecord error callback. * @param { 'error' } type - Type of the AVScreenCaptureRecord event to listen for. * @param { ErrorCallback } callback - Callback used to listen for the AVScreenCaptureRecord error return. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ off(type: 'error', callback?: ErrorCallback): void; } @@ -8778,12 +9371,12 @@ declare namespace media { interface AVTranscoderConfig { /** * Indicates the audio bitrate. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVTranscoder * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - audioBitrate?: int; + audioBitrate?: number; /** * Indicates the audio encoding format. @@ -8805,12 +9398,12 @@ declare namespace media { /** * Indicates the video bitrate. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVTranscoder * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - videoBitrate?: int; + videoBitrate?: number; /** * Indicates the video encoding foramt. @@ -8823,21 +9416,21 @@ declare namespace media { /** * Indicates the video width. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVTranscoder * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - videoFrameWidth?: int; + videoFrameWidth?: number; /** * Indicates the video height. - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.AVTranscoder * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - videoFrameHeight?: int; + videoFrameHeight?: number; } /** @@ -8864,7 +9457,8 @@ declare namespace media { * Destination media file descriptor. Mainstream media formats are supported. * @type { number } * @syscap SystemCapability.Multimedia.Media.AVTranscoder - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ fdDst: number; @@ -8889,7 +9483,8 @@ declare namespace media { * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVTranscoder - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ start(): Promise; @@ -8912,7 +9507,8 @@ declare namespace media { * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVTranscoder - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ resume(): Promise; @@ -8923,7 +9519,8 @@ declare namespace media { * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. * @syscap SystemCapability.Multimedia.Media.AVTranscoder - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ cancel(): Promise; @@ -8948,6 +9545,22 @@ declare namespace media { */ on(type:'complete', callback: Callback):void; + /** + * Register listener for trancoding error event. + * @param { 'error' } type - Type of the event to listen for. + * @param { ErrorCallback } callback - Callback used to listen for the error event. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 5400101 - No memory. + * @throws { BusinessError } 5400102 - Operation not allowed. + * @throws { BusinessError } 5400103 - I/O error. + * @throws { BusinessError } 5400104 - Time out. + * @throws { BusinessError } 5400105 - Service died. + * @throws { BusinessError } 5400106 - Unsupported format. + * @syscap SystemCapability.Multimedia.Media.AVTranscoder + * @since 12 + */ + on(type:'error', callback: ErrorCallback):void; /** * Register listener for trancoding error event. * @param { 'error' } type - Type of the event to listen for. @@ -8961,20 +9574,20 @@ declare namespace media { * @throws { BusinessError } 5400105 - Service died. * @throws { BusinessError } 5400106 - Unsupported format. * @syscap SystemCapability.Multimedia.Media.AVTranscoder - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ on(type:'error', callback: ErrorCallback):void; /** * Register listener for trancoding progressUpdate event. * @param { 'progressUpdate' } type - Type of the event to listen for. - * @param { Callback } callback - Callback used to listen for the progressUpdate event. + * @param { Callback } callback - Callback used to listen for the progressUpdate event. * @syscap SystemCapability.Multimedia.Media.AVTranscoder * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - on(type:'progressUpdate', callback: Callback):void; + on(type:'progressUpdate', callback: Callback):void; /** * Unregister listener for trancoding complete event. @@ -8986,25 +9599,33 @@ declare namespace media { */ off(type:'complete', callback?: Callback):void; + /** + * Unregister listener for trancoding error event. + * @param { 'error' } type - Type of the event to listen for. + * @param { ErrorCallback } [callback] - Callback used to listen for the error event. + * @syscap SystemCapability.Multimedia.Media.AVTranscoder + * @since 12 + */ + off(type:'error', callback?: ErrorCallback):void; /** * Unregister listener for trancoding error event. * @param { 'error' } type - Type of the event to listen for. * @param { ErrorCallback } [callback] - Callback used to listen for the error event. * @syscap SystemCapability.Multimedia.Media.AVTranscoder - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ off(type:'error', callback?: ErrorCallback):void; /** * Unregister listener for trancoding progressUpdate event. * @param { 'progressUpdate' } type - Type of the event to listen for. - * @param { Callback } [callback] - Callback used to listen for the progressUpdate event. + * @param { Callback } [callback] - Callback used to listen for the progressUpdate event. * @syscap SystemCapability.Multimedia.Media.AVTranscoder * @since arkts {'1.1':'12','1.2':'20'} * @arkts 1.1&1.2 */ - off(type:'progressUpdate', callback?: Callback):void; + off(type:'progressUpdate', callback?: Callback):void; } /** diff --git a/api/multimedia/soundPool.d.ts b/api/multimedia/soundPool.d.ts index 47c0c8c668495219f69f8017f26c2477ee4e7481..9e2313afd614ec95650c3f27afe008f1f9130c29 100644 --- a/api/multimedia/soundPool.d.ts +++ b/api/multimedia/soundPool.d.ts @@ -32,48 +32,48 @@ export interface PlayParameters { /** * loop mode (0 = no loop, -1 = loop forever) * - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.SoundPool * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - loop?: int; + loop?: number; /** * playback rate * - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.SoundPool * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - rate?: int; + rate?: number; /** * left volume value(range = 0.0 to 1.0),current leftVolume = rightVolume * - * @type { ?double } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.SoundPool * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - leftVolume?: double; + leftVolume?: number; /** * right volume value(range = 0.0 to 1.0),current leftVolume = rightVolume * - * @type { ?double } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.SoundPool * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - rightVolume?: double; + rightVolume?: number; /** * stream priority (0 = lowest priority) * - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.Multimedia.Media.SoundPool * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - priority?: int; + priority?: number; /** * Flag indicating that the sound effect and audio can be played in parallel. * @@ -99,7 +99,7 @@ export interface SoundPool { * Load the sound from the specified path. * * @param {string} uri The path to the audio file - * @param {AsyncCallback} callback Callback a sound ID. This value can be used to play or unload the sound. + * @param {AsyncCallback} callback Callback a sound ID. This value can be used to play or unload the sound. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @throws { BusinessError } 5400103 - I/O error. Return by callback. * @throws { BusinessError } 5400105 - Service died. Return by callback. @@ -107,12 +107,12 @@ export interface SoundPool { * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - load(uri: string, callback: AsyncCallback): void; + load(uri: string, callback: AsyncCallback): void; /** * Load the sound from the specified path. * * @param {string} uri The path to the audio file - * @returns {Promise} Promise a sound ID. This value can be used to play or unload the sound. + * @returns {Promise} Promise a sound ID. This value can be used to play or unload the sound. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @throws { BusinessError } 5400103 - I/O error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. @@ -120,14 +120,14 @@ export interface SoundPool { * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - load(uri: string): Promise; + load(uri: string): Promise; /** * Load the sound from a FileDescriptor. * - * @param {int} fd A FileDescriptor object - * @param {double} offset Offset to the start of the sound - * @param {double} length Length of the sound - * @param {AsyncCallback} callback Callback a sound ID. This value can be used to play or unload the sound. + * @param {number} fd A FileDescriptor object + * @param {number} offset Offset to the start of the sound + * @param {number} length Length of the sound + * @param {AsyncCallback} callback Callback a sound ID. This value can be used to play or unload the sound. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @throws { BusinessError } 5400103 - I/O error. Return by callback. * @throws { BusinessError } 5400105 - Service died. Return by callback. @@ -135,14 +135,14 @@ export interface SoundPool { * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - load(fd: int, offset: double, length: double, callback: AsyncCallback): void; + load(fd: number, offset: number, length: number, callback: AsyncCallback): void; /** * Load the sound from a FileDescriptor. * - * @param {int} fd A FileDescriptor object - * @param {double} offset Offset to the start of the sound - * @param {double} length Length of the sound - * @returns {Promise} Promise a sound ID. This value can be used to play or unload the sound. + * @param {number} fd A FileDescriptor object + * @param {number} offset Offset to the start of the sound + * @param {number} length Length of the sound + * @returns {Promise} Promise a sound ID. This value can be used to play or unload the sound. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @throws { BusinessError } 5400103 - I/O error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. @@ -150,13 +150,13 @@ export interface SoundPool { * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - load(fd: int, offset: double, length: double): Promise; + load(fd: number, offset: number, length: number): Promise; /** * Play a sound from a sound ID. * - * @param {int} soundID Returned by the load() + * @param {number} soundID Returned by the load() * @param {PlayParameters} params Player parameters - * @param {AsyncCallback} callback Callback used to return a non-zero streamID if successful, zero if it fails. + * @param {AsyncCallback} callback Callback used to return a non-zero streamID if successful, zero if it fails. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. 3.Parameter verification failed. Return by callback. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. @@ -165,12 +165,12 @@ export interface SoundPool { * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - play(soundID: int, params: PlayParameters, callback: AsyncCallback): void; + play(soundID: number, params: PlayParameters, callback: AsyncCallback): void; /** * Play a sound from a sound ID. * - * @param {int} soundID Returned by the load() - * @param {AsyncCallback} callback Callback used to return a non-zero streamID if successful, zero if it fails. + * @param {number} soundID Returned by the load() + * @param {AsyncCallback} callback Callback used to return a non-zero streamID if successful, zero if it fails. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. 3.Parameter verification failed. Return by callback. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. @@ -179,13 +179,13 @@ export interface SoundPool { * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - play(soundID: int, callback: AsyncCallback): void; + play(soundID: number, callback: AsyncCallback): void; /** * Play a sound from a sound ID. * - * @param {int} soundID Returned by the load() + * @param {number} soundID Returned by the load() * @param {PlayParameters} [params] Player parameters - * @returns {Promise} Promise used to return a non-zero streamID if successful, zero if it fails. + * @returns {Promise} Promise used to return a non-zero streamID if successful, zero if it fails. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. 3.Parameter verification failed. Return by promise. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. @@ -194,11 +194,11 @@ export interface SoundPool { * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - play(soundID: int, params?: PlayParameters): Promise; + play(soundID: number, params?: PlayParameters): Promise; /** * Stop a stream which is playing. * - * @param {int} streamID Returned by the play() + * @param {number} streamID Returned by the play() * @param {AsyncCallback} callback Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. 3.Parameter verification failed. Return by callback. @@ -208,11 +208,11 @@ export interface SoundPool { * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - stop(streamID: int, callback: AsyncCallback): void; + stop(streamID: number, callback: AsyncCallback): void; /** * Stop a stream which is playing. * - * @param {int} streamID Returned by the play() + * @param {number} streamID Returned by the play() * @returns {Promise} Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. 3.Parameter verification failed. Return by promise. @@ -222,12 +222,12 @@ export interface SoundPool { * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - stop(streamID: int): Promise; + stop(streamID: number): Promise; /** * Set loop mode. * - * @param {int} streamID Returned by the play() - * @param {int} loop Loop mode (0 = no loop, -1 = loop forever) + * @param {number} streamID Returned by the play() + * @param {number} loop Loop mode (0 = no loop, -1 = loop forever) * @param {AsyncCallback} callback Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. 3.Parameter verification failed. Return by callback. @@ -236,12 +236,12 @@ export interface SoundPool { * @syscap SystemCapability.Multimedia.Media.SoundPool * @since 10 */ - setLoop(streamID: int, loop: int, callback: AsyncCallback): void; + setLoop(streamID: number, loop: number, callback: AsyncCallback): void; /** * Set loop mode. * - * @param {int} streamID Returned by the play() - * @param {int} loop Loop mode (0 = no loop, -1 = loop forever) + * @param {number} streamID Returned by the play() + * @param {number} loop Loop mode (0 = no loop, -1 = loop forever) * @returns {Promise} Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. 3.Parameter verification failed. Return by promise. @@ -250,12 +250,12 @@ export interface SoundPool { * @syscap SystemCapability.Multimedia.Media.SoundPool * @since 10 */ - setLoop(streamID: int, loop: int): Promise; + setLoop(streamID: number, loop: number): Promise; /** * Set stream priority. * - * @param {int} streamID Returned by the play() - * @param {int} priority Stream priority (0 = lowest priority) + * @param {number} streamID Returned by the play() + * @param {number} priority Stream priority (0 = lowest priority) * @param {AsyncCallback} callback Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. 3.Parameter verification failed. Return by callback. @@ -264,12 +264,12 @@ export interface SoundPool { * @syscap SystemCapability.Multimedia.Media.SoundPool * @since 10 */ - setPriority(streamID: int, priority: int, callback: AsyncCallback): void; + setPriority(streamID: number, priority: number, callback: AsyncCallback): void; /** * Set stream priority. * - * @param {int} streamID Returned by the play() - * @param {int} priority Stream priority (0 = lowest priority) + * @param {number} streamID Returned by the play() + * @param {number} priority Stream priority (0 = lowest priority) * @returns {Promise} Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. 3.Parameter verification failed. Return by promise. @@ -278,11 +278,11 @@ export interface SoundPool { * @syscap SystemCapability.Multimedia.Media.SoundPool * @since 10 */ - setPriority(streamID: int, priority: int): Promise; + setPriority(streamID: number, priority: number): Promise; /** * Set playback rate. * - * @param {int} streamID Returned by the play() + * @param {number} streamID Returned by the play() * @param {audio.AudioRendererRate} rate Playback rate * @param {AsyncCallback} callback Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. @@ -292,11 +292,11 @@ export interface SoundPool { * @syscap SystemCapability.Multimedia.Media.SoundPool * @since 10 */ - setRate(streamID: int, rate: audio.AudioRendererRate, callback: AsyncCallback): void; + setRate(streamID: number, rate: audio.AudioRendererRate, callback: AsyncCallback): void; /** * Set playback rate. * - * @param {int} streamID Returned by the play() + * @param {number} streamID Returned by the play() * @param {audio.AudioRendererRate} rate Playback rate * @returns {Promise} Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. @@ -306,13 +306,13 @@ export interface SoundPool { * @syscap SystemCapability.Multimedia.Media.SoundPool * @since 10 */ - setRate(streamID: int, rate: audio.AudioRendererRate): Promise; + setRate(streamID: number, rate: audio.AudioRendererRate): Promise; /** * Set stream volume. * - * @param {int} streamID Returned by the play() - * @param {double} leftVolume Volume value(range = 0.0 to 1.0),current leftVolume = rightVolume - * @param {double} rightVolume Volume value(range = 0.0 to 1.0),current leftVolume = rightVolume + * @param {number} streamID Returned by the play() + * @param {number} leftVolume Volume value(range = 0.0 to 1.0),current leftVolume = rightVolume + * @param {number} rightVolume Volume value(range = 0.0 to 1.0),current leftVolume = rightVolume * @param {AsyncCallback} callback Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. 3.Parameter verification failed. Return by callback. @@ -321,13 +321,13 @@ export interface SoundPool { * @syscap SystemCapability.Multimedia.Media.SoundPool * @since 10 */ - setVolume(streamID: int, leftVolume: double, rightVolume: double, callback: AsyncCallback): void; + setVolume(streamID: number, leftVolume: number, rightVolume: number, callback: AsyncCallback): void; /** * Set stream volume. * - * @param {int} streamID Returned by the play() - * @param {double} leftVolume Volume value(range = 0.0 to 1.0),current leftVolume = rightVolume - * @param {double} rightVolume Volume value(range = 0.0 to 1.0),current leftVolume = rightVolume + * @param {number} streamID Returned by the play() + * @param {number} leftVolume Volume value(range = 0.0 to 1.0),current leftVolume = rightVolume + * @param {number} rightVolume Volume value(range = 0.0 to 1.0),current leftVolume = rightVolume * @returns {Promise} Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. 3.Parameter verification failed. Return by promise. @@ -336,11 +336,11 @@ export interface SoundPool { * @syscap SystemCapability.Multimedia.Media.SoundPool * @since 10 */ - setVolume(streamID: int, leftVolume: double, rightVolume: double): Promise; + setVolume(streamID: number, leftVolume: number, rightVolume: number): Promise; /** * Unload a sound from a sound ID. * - * @param {int} soundID Returned by the load() + * @param {number} soundID Returned by the load() * @param {AsyncCallback} callback Callback used to return the result. * @throws { BusinessError } 5400102 - Operation not allowed. Return by callback. * @throws { BusinessError } 5400103 - I/O error. Return by callback. @@ -349,11 +349,11 @@ export interface SoundPool { * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - unload(soundID: int, callback: AsyncCallback): void; + unload(soundID: number, callback: AsyncCallback): void; /** * Unload a sound from a sound ID. * - * @param {int} soundID Returned by the load() + * @param {number} soundID Returned by the load() * @returns {Promise} Promise used to return the result. * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. * @throws { BusinessError } 5400103 - I/O error. Return by promise. @@ -362,7 +362,7 @@ export interface SoundPool { * @since arkts {'1.1':'10','1.2':'20'} * @arkts 1.1&1.2 */ - unload(soundID: int): Promise; + unload(soundID: number): Promise; /** * Releases the soundPool. This method uses an asynchronous callback to return the result. * @@ -412,13 +412,13 @@ export interface SoundPool { * @since 18 */ on(type: 'playFinishedWithStreamId', callback: Callback): void; - /** - * Cancel listening for playing finished event. - * - * @param {'playFinishedWithStreamId'} type name of the play finished event to listen for. - * @syscap SystemCapability.Multimedia.Media.SoundPool - * @since 18 - */ + /** + * Cancel listening for playing finished event. + * + * @param {'playFinishedWithStreamId'} type name of the play finished event to listen for. + * @syscap SystemCapability.Multimedia.Media.SoundPool + * @since 18 + */ off(type: 'playFinishedWithStreamId'): void; /** * Register listens for play finish event. @@ -457,20 +457,20 @@ export interface SoundPool { /** * Register listens for events. * - * @param {'playFinishedWithStreamId' | 'playFinished' | 'error' | 'loadComplete'} type name of the event to listen for. - * @param {Callback | Callback | ErrorCallback} callback Callback used to listen. + * @param {'playFinishedWithStreamId' | 'playFinished' | 'error' | 'loadComplete'} type name of the event to listen for. + * @param {Callback | Callback | ErrorCallback} callback Callback used to listen. * @syscap SystemCapability.Multimedia.Media.SoundPool - * @since arkts {'1.2':'20'} + * @since 20 * @arkts 1.2 */ on(type: 'playFinishedWithStreamId' | 'playFinished' | 'error' | 'loadComplete', - callback: Callback | Callback | ErrorCallback): void; + callback: Callback | Callback | ErrorCallback): void; /** * Cancel listening for event. * * @param {'playFinishedWithStreamId' | 'loadComplete' | 'playFinished' | 'error'} type name of the event to listen for. * @syscap SystemCapability.Multimedia.Media.SoundPool - * @since arkts {'1.2':'20'} + * @since 20 * @arkts 1.2 */ off(type: 'playFinishedWithStreamId' | 'loadComplete' | 'playFinished' | 'error'): void;