diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index a20f26902b78630761d6d32bdc4f7587912f77e3..c05fe18a889a2b61495f8b798edda7027eb63325 100644 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -4468,7 +4468,361 @@ declare namespace media { * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ - off(type:'superResolutionChanged', callback?: OnSuperResolutionChanged): void; + off(type:'superResolutionChanged', callback?: OnSuperResolutionChanged): void; + + + overload on { onMediaKeySystemInfoUpdate, onStateChange, onVolumeChange, onEndOfStream, onSeekDone, onSpeedDone, + onPlaybackRateDone, onBitrateDone, onTimeUpdate, onDurationUpdate, onBufferingUpdate, onStartRenderFrame, + onVideoSizeChange, onAudioInterrupt, onAvailableBitrates, onError, onAudioOutputDeviceChangeWithInfo, + onSubtitleUpdate, onTrackChange, onTrackInfoUpdate, onAmplitudeUpdate, onSeiMessageReceived, + onSuperResolutionChanged + }; + + /** + * Register listens for mediaKeySystemInfoUpdate events. + * @param { 'mediaKeySystemInfoUpdate' } type - Event type, which is **'mediaKeySystemInfoUpdate'** in this case. + * This event is triggered when the copyright protection information of the media asset being played changes. + * @param { Callback> } callback - Callback invoked when the event is triggered. + * It reports a **MediaKeySystemInfo** array. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onMediaKeySystemInfoUpdate(type: 'mediaKeySystemInfoUpdate', callback: Callback>): void; + + /** + * Register listens for media playback stateChange event. + * @param { 'stateChange' } type - Event type, which is **'stateChange'** in this case. + * This event can be triggered by both user operations and the system. + * @param { OnAVPlayerStateChangeHandle } callback - Callback invoked when the event is triggered. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onStateChange(type: 'stateChange', callback: OnAVPlayerStateChangeHandle): void; + + /** + * Subscribes to the event to check whether the volume is successfully set. + * @param { 'volumeChange' } type - This event is triggered each time **setVolume()** is called. + * @param { Callback } callback - Callback invoked when the event is triggered. + * It reports the effective volume. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onVolumeChange(type: 'volumeChange', callback: Callback): void; + + /** + * Subscribes to the event that indicates the end of the stream being played. If {@link #loop} = true is set, + * the AVPlayer seeks to the beginning of the stream and plays the stream again. If loop is not set, + * the completed state is reported through the {@link #stateChange} event. + * @param { 'endOfStream' } type - Type of the playback event to listen for. This event is triggered + * when the AVPlayer finishes playing the media asset. + * @param { Callback } callback - Callback invoked when the event is triggered. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onEndOfStream(type: 'endOfStream', callback: Callback): void; + + /** + * Subscribes to the event to check whether the seek operation takes effect. + * @param { 'seekDone' } type - Type of the playback event to listen for. This event is triggered each time + * **seek()** is called, except in SEEK_CONTINUOUS mode. + * @param { Callback } callback - Callback invoked when the event is triggered. + * It reports the time position requested by the user. + * + * For video playback, {@link #SeekMode} may cause the actual position to be different from that requested by + * the user.The exact position can be obtained from the currentTime attribute. The time in this callback + * only means that the requested seek operation is complete. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onSeekDone(type: 'seekDone', callback: Callback): void; + + /** + * Subscribes to the event to check whether the playback speed is successfully set. + * @param { 'speedDone' } type - Type of the playback event to listen for. + * This event is triggered each time **setSpeed()** is called. + * @param { Callback } callback - Callback used to return the result. When the call of + * setSpeed is successful, the effective speed mode is reported. For details, see {@link #PlaybackSpeed}. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onSpeedDone(type: 'speedDone', callback: Callback): void; + + /** + * Register listens for media playbackRateDone event. + * @param { 'playbackRateDone' } type - Type of the playback event to listen for. + * @param { OnPlaybackRateDone } callback - Callback used to listen for the playbackRateDone event. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onPlaybackRateDone(type: 'playbackRateDone', callback: OnPlaybackRateDone): void; + + /** + * Subscribes to the event to check whether the bit rate is successfully set. + * @param { 'bitrateDone' } type - Type of the playback event to listen for. + * This event is triggered each time **setBitrate()** is called. + * @param { Callback } callback - Callback invoked when the event is triggered. + * It reports the effective bit rate. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onBitrateDone(type: 'bitrateDone', callback: Callback): void; + + /** + * Subscribes to playback position changes. It is used to refresh the current position of the progress bar. + * By default, this event is reported every 100 ms. However, it is reported immediately upon + * a successful seek operation. + * @param { 'timeUpdate' } type - Type of the playback event to listen for. + * @param { Callback } callback - Callback used to return the current time. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onTimeUpdate(type: 'timeUpdate', callback: Callback): void; + + /** + * Subscribes to media asset duration changes. It is used to refresh the length of the progress bar. By + * default, this event is reported once in the prepared state. However, it can be repeatedly reported for + * special streams that trigger duration changes. The **'durationUpdate'** event is not supported in live mode. + * @param { 'durationUpdate' } type - Type of the playback event to listen for. + * @param { Callback } callback - Callback used to return the resource duration. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onDurationUpdate(type: 'durationUpdate', callback: Callback): void; + + /** + * Subscribes to audio and video buffer changes. This subscription is supported only in network + * playback scenarios. + * @param { 'bufferingUpdate' } type - Type of the playback buffering update event to listen for. + * @param { OnBufferingUpdateHandler } callback - Callback invoked when the event is triggered, + * and return BufferingInfoType and the value. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onBufferingUpdate(type: 'bufferingUpdate', callback: OnBufferingUpdateHandler): void; + + /** + * Subscribes to the event that indicates rendering starts for the first frame. This subscription is + * supported only in video playback scenarios. This event only means that the playback service sends + * the first frame to the display module. The actual rendering effect depends on the rendering performance + * of the display service. + * @param { 'startRenderFrame' } type - Type of the playback event to listen for. + * @param { Callback } callback - Callback invoked when the event is triggered. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onStartRenderFrame(type: 'startRenderFrame', callback: Callback): void; + + /** + * Subscribes to video size (width and height) changes. This subscription is supported only in video playback + * scenarios. By default, this event is reported only once in the prepared state. However, it is also reported + * upon resolution changes in the case of HLS streams. + * @param { 'videoSizeChange' } type - Type of the playback event to listen for. + * @param { OnVideoSizeChangeHandler } callback - Callback invoked when the event is triggered. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onVideoSizeChange(type: 'videoSizeChange', callback: OnVideoSizeChangeHandler): void; + + /** + * Register listens for audio interrupt event, refer to {@link #audio.InterruptEvent}. + * The application needs to perform corresponding processing based on different audio interruption events. + * For details, see Handling Audio Interruption Events. + * @param { 'audioInterrupt' } type - Type of the playback event to listen for. + * @param { Callback } callback - Callback used to listen for the playback event return audio interrupt info. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onAudioInterrupt(type: 'audioInterrupt', callback: Callback): void; + + /** + * 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. + * This event is triggered once after the AVPlayer switches to the prepared state. + * @param { Callback> } callback - Callback used to listen for the playback event return available bitrate list. + * It returns an array that holds the available bit rates. If the array length is 0, no bit rate can be set. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onAvailableBitrates(type: 'availableBitrates', callback: Callback>): void; + + /** + * Subscribes to AVPlayer errors. This event is used only for error prompt and does not require the user to stop + * playback control. If AVPlayerState is also switched to error, call {@link #reset()} or {@link #release()} + * to exit the playback. + * @param { 'error' } type - Event type, which is **'error'** in this case. This event can be triggered by + * both user operations and the system. + * @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 20 + * @arkts 1.2 + */ + onError(type: 'error', callback: ErrorCallback): void; + + /** + * Subscribes to audio stream output device changes and reasons. This API uses an asynchronous callback + * to return the result. + * + * When subscribing to this event, you are advised to implement the player behavior when the device is + * connected or disconnected by referring to Responding to Audio Output Device Changes. + * @param { 'audioOutputDeviceChangeWithInfo' } type - Type of the event to listen for. + * The event is triggered when the output device is changed. + * @param { Callback } callback - Callback used to return the output device + * descriptor of the current audio stream and the change reason. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3.Parameter verification failed. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onAudioOutputDeviceChangeWithInfo(type: 'audioOutputDeviceChangeWithInfo', callback: Callback): void; + + /** + * Subscribes to subtitle update events. When external subtitles exist, the system notifies the application + * through the subscribed-to callback. An application can subscribe to only one subtitle update event. When + * the application initiates multiple subscriptions to this event, the last subscription is applied. + * @param { 'subtitleUpdate' } type - Type of the event to listen for. + * The event is triggered when the external subtitle is updated. + * @param { Callback } callback - Callback invoked when the subtitle is updated. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onSubtitleUpdate(type: 'subtitleUpdate', callback: Callback): void + + /** + * Subscribes to track change events. When the track changes, the system notifies the application through + * the subscribed-to callback. An application can subscribe to only one track change event. When the + * application initiates multiple subscriptions to this event, the last subscription is applied. + * @param { 'trackChange' } type - Type of the event to listen for. + * The event is triggered when the track changes. + * @param { OnTrackChangeHandler } callback - Callback invoked when the event is triggered. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onTrackChange(type: 'trackChange', callback: OnTrackChangeHandler): void + + /** + * Subscribes to track information update events. When the track information is updated, the system notifies the + * application through the subscribed-to callback. An application can subscribe to only one track change event. + * When the application initiates multiple subscriptions to this event, the last subscription is applied. + * @param { 'trackInfoUpdate' } type - Type of the event to listen for. + * The event is triggered when the track information is updated. + * @param { Callback> } callback - Callback invoked when the event is triggered. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onTrackInfoUpdate(type: 'trackInfoUpdate', callback: Callback>): void + + /** + * Subscribes to update events of the maximum audio level value, which is periodically reported when audio + * resources are played. + * @param { 'amplitudeUpdate' } type - Type of the event to listen for. + * The event is triggered when the amplitude changes. + * @param { Callback> } callback - Callback invoked when the event is triggered. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 20 + * @arkts 1.2 + */ + onAmplitudeUpdate(type: 'amplitudeUpdate', callback: Callback>): void + + /** + * Subscribes to events indicating that a Supplemental Enhancement Information (SEI) message is received. This + * applies only to HTTP-FLV live streaming and is triggered when SEI messages are present in the video stream. + * You must initiate the subscription before calling {@link #prepare}. If you initiate multiple subscriptions + * to this event, the last subscription is applied. + * @param { 'seiMessageReceived' } type - Type of the playback event to listen for. + * The event is triggered when an SEI message is received. + * @param { Array } payloadTypes - Array of subscribed-to payload types of SEI messages. Currently, + * only payloadType = 5 is supported. + * @param { OnSeiMessageHandle } callback - Callback used to listen for SEI message events and receive the + * subscribed-to payload types. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onSeiMessageReceived(type: 'seiMessageReceived', payloadTypes: Array, callback: OnSeiMessageHandle): void; + + /** + * Subscribes to the event indicating that super resolution is enabled or disabled. + * @param { 'superResolutionChanged' } type - Type of the super-resolution event to listen for. + * The event is triggered when super resolution is enabled or disabled. + * @param { OnSuperResolutionChanged } callback - Callback used to listen for the super-resolution changed event. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onSuperResolutionChanged(type:'superResolutionChanged', callback: OnSuperResolutionChanged): void; } /** @@ -6929,12 +7283,86 @@ declare namespace media { */ on(type: 'error', callback: ErrorCallback): void; + overload on { onAudioCapturerChange, onPhotoAssetAvailable, onStateChange, onError } + /** - * Cancel Listens for recording stateChange events. - * @param { 'stateChange' } type - Type of the recording stateChange event to listen for. + * Subscribes to audio capturer configuration changes. Any configuration change triggers the callback that + * returns the entire configuration information. + * + * When the application initiates multiple subscriptions to this event, the last subscription is applied. + * @param { 'audioCapturerChange' } type - Event type, which is **'audioCapturerChange'** in this case. + * @param { Callback } callback - Callback used to return the entire configuration + * information about the audio capturer. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. 3.Parameter verification failed. * @syscap SystemCapability.Multimedia.Media.AVRecorder - * @since 9 + * @since 20 + * @arkts 1.2 + */ + onAudioCapturerChange(type: 'audioCapturerChange', callback: Callback): void; + + /** + * Subscribes to media asset callback events. When FileGenerationMode is used during media file creation, + * the PhotoAsset object is called back to the application after the stop operation is complete. + * + * When the application initiates multiple subscriptions to this event, the last subscription is applied. + * @param { 'photoAssetAvailable' } type - Event type, which is **'photoAssetAvailable'** in this case. + * The event is triggered when a photo asset is available. + * @param { Callback } callback - Callback used to return the + * **PhotoAsset** object corresponding to the resource file created by the system. + * @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 + */ + onPhotoAssetAvailable(type: 'photoAssetAvailable', callback: Callback): void; + + /** + * Subscribes to AVRecorder state changes. An application can subscribe to only one AVRecorder state change event. + * When the application initiates multiple subscriptions to this event, the last subscription is applied. + * @param { 'stateChange' } type - Event type, which is **'stateChange'** in this case. + * This event can be triggered by both user operations and the system. + * @param { OnAVRecorderStateChangeHandler } callback - Callback invoked when the event is triggered. + * @throws { BusinessError } 5400103 - IO error. Return by callback. + * @throws { BusinessError } 5400105 - Service died. Return by callback. + * @syscap SystemCapability.Multimedia.Media.AVRecorder + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onStateChange(type: 'stateChange', callback: OnAVRecorderStateChangeHandler): void; + + /** + * Subscribes to AVRecorder errors. This event is used only for error prompt and does not require the user to + * stop recording control. If the AVRecorderState is also switched to error, call reset() or release() + * to exit the recording. + * + * An application can subscribe to only one AVRecorder error event. + * When the application initiates multiple subscriptions to this event, the last subscription is applied. + * @param { 'error' } type - Event type, which is **'error'** in this case. + * This event is triggered when an error occurs during recording. + * @param { ErrorCallback } callback - Callback invoked when the event is triggered. + * @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 20 + * @arkts 1.2 */ + onError(type: 'error', callback: ErrorCallback): void; + /** * Unsubscribes from AVRecorder state changes. * @param { 'stateChange' } type - Event type, which is **'stateChange'** in this case. @@ -7841,6 +8269,22 @@ declare namespace media { */ on(type: 'error', callback: ErrorCallback): void; + overload on { onError }; + /** + * 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 + */ + onError(type: 'error', callback: ErrorCallback): void; + /** * video recorder state. * @type { VideoRecordState } @@ -10568,6 +11012,43 @@ declare namespace media { */ on(type: 'error', callback: ErrorCallback): void; + overload on { onStateChange, onError }; + /** + * Subscribes to screen capture state changes. An application can subscribe to only one screen capture + * state change event. When the application initiates multiple subscriptions to this event, + * the last subscription is applied. + * @param { 'stateChange' } type - Event type, which is **'stateChange'** in this case. + * @param { Callback } callback - Callback invoked when the event is triggered. + * AVScreenCaptureStateCode indicates the new state. + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @since 20 + * @example + * avScreenCaptureRecorder.on('stateChange', (state: media.AVScreenCaptureStateCode) => { + * console.info('avScreenCaptureRecorder stateChange to ' + state); + * }) + * @arkts 1.2 + */ + onStateChange(type: 'stateChange', callback: Callback): void; + + /** + * Subscribes to AVScreenCaptureRecorder errors. You can handle the errors based on the application logic. + * An application can subscribe to only one AVScreenCaptureRecorder error event. + * When the application initiates multiple subscriptions to this event, the last subscription is applied. + * @param { 'error' } type - Event type, which is **'error'** in this case. + * @param { ErrorCallback } callback - Callback invoked when the event is triggered. + * @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 20 + * @example + * avScreenCaptureRecorder.on('error', (err: BusinessError) => { + * console.error('avScreenCaptureRecorder error:' + err.message); + * }) + * @arkts 1.2 + */ + onError(type: 'error', callback: ErrorCallback): void; + /** * Unsubscribes from screen capture state changes. You can specify a callback to cancel the specified subscription. * @param { 'stateChange' } type - Event type, which is **'stateChange'** in this case. @@ -10862,6 +11343,61 @@ declare namespace media { */ on(type:'progressUpdate', callback: Callback):void; + overload on { onComplete, onError, onProgressUpdate }; + /** + * Subscribes to the event indicating that transcoding is complete. + * An application can subscribe to only one transcoding completion event. + * When the application initiates multiple subscriptions to this event, the last subscription is applied. + * + * When this event is reported, the current transcoding operation is complete. + * You need to call [release()]{@link AVTranscoder.release} to exit the transcoding. + * @param { 'complete' } type - Event type, which is **'complete'** in this case. + * This event is triggered by the system during transcoding. + * @param { Callback } callback - Callback that has been registered to listen for + * transcoding completion events. + * @syscap SystemCapability.Multimedia.Media.AVTranscoder + * @since 20 + * @arkts 1.2 + */ + onComplete(type:'complete', callback: Callback):void; + + /** + * Subscribes to AVTranscoder errors. If this event is reported, call [release()]{@link AVTranscoder.release} + * to exit the transcoding. + * + * An application can subscribe to only one AVTranscoder error event. + * When the application initiates multiple subscriptions to this event, the last subscription is applied. + * @param { 'error' } type - Event type, which is **'error'** in this case. + * + * This event is triggered when an error occurs during transcoding. + * @param { ErrorCallback } callback - Callback invoked when the event is triggered. + * @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 20 + * @arkts 1.2 + */ + onError(type:'error', callback: ErrorCallback):void; + + /** + * Subscribes to transcoding progress updates. An application can subscribe to only one transcoding progress update + * event. When the application initiates multiple subscriptions to this event, the last subscription is applied. + * @param { 'progressUpdate' } type - Event type, which is **'progressUpdate'** in this case. + * This event is triggered by the system during transcoding. + * @param { Callback } callback - Callback invoked when the event is triggered. + * **progress** is a number that indicates the current transcoding progress. + * @syscap SystemCapability.Multimedia.Media.AVTranscoder + * @since 20 + * @arkts 1.2 + */ + onProgressUpdate(type:'progressUpdate', callback: Callback):void; + /** * Unsubscribes from the event indicating that transcoding is complete. * @param { 'complete' } type - Event type, which is **'complete'** in this case. @@ -10961,6 +11497,29 @@ declare namespace media { */ on(type: 'systemScreenRecorder', callback: Callback): void; + overload on { onSystemScreenRecorder }; + + /** + * Subscribes to state change events of the system screen recorder. From the ScreenCaptureEvent event reported, + * you can determine whether the system screen recorder is working. + * @param { 'systemScreenRecorder' } type - Event type, which is **'systemScreenRecorder'** in this case. + * This event is triggered when the state of the system screen recorder changes. + * @param { Callback } callback - Callback invoked when the event is triggered, + * where ScreenCaptureEvent indicates the new state. + * @throws { BusinessError } 202 - Not System App. + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @systemapi + * @since 20 + * @example + * // This event is reported when the state of the system screen recorder changes. + * screenCaptureMonitor.on('systemScreenRecorder', (event: media.ScreenCaptureEvent) => { + * // Set the 'systemScreenRecorder' event callback. + * console.info(`system ScreenRecorder event: ${event}`); + * }) + * @arkts 1.2 + */ + onSystemScreenRecorder(type: 'systemScreenRecorder', callback: Callback): void; + /** * Unsubscribes from state change events of the system screen recorder. * @param { 'systemScreenRecorder' } type - Event type, which is **'systemScreenRecorder'** in this case.