Callbacks and listeners
This topic describes the callbacks and listeners of the Ohos software development kit (SDK).
Contents
DingRtcEventListener: Callbacks and listeners
API | Description | Minimum supported version |
Callback for joining a channel. | 3.0 | |
Callback for leaving a channel. | 3.0 | |
Callback for the remaining duration of a channel. | 3.0 | |
Callback for a change in the audio stream ingest state. | 3.0 | |
Callback for a change in the video stream ingest state. | 3.0 | |
Callback for a change in the screen sharing stream ingest state. | 3.0 | |
Callback for a change in the audio subscription state. | 3.0 | |
Callback for a change in the camera stream subscription state. | 3.0 | |
Callback for a change in the subscription state of large and small streams. | 3.0 | |
Callback for a change in the screen sharing stream subscription state. | 3.0 | |
Message sent when the network quality changes. | 3.0 | |
Warning notification. | 3.0 | |
Error notification. | 3.0 | |
The network connection state changes. | 3.0 | |
Callback for a remote user joining a channel in communication mode. | 3.0 | |
Callback for a remote user leaving a channel in communication mode. | 3.0 | |
Callback for a change in the audio and video streams of a remote user. | 3.0 | |
This message is triggered when the first video frame of a remote user is displayed. | 3.0 | |
This callback is triggered when the video renderer detects a change in the resolution of a remote video. | 3.2.1 | |
This callback is triggered when the video renderer detects a change in the resolution of the local video. | 3.2.1 | |
This message is triggered when the preview starts to display the first video frame. | 3.0 | |
Callback for receiving the first video frame from a remote user. | 3.0 | |
Callback for sending the first video packet. | 3.0 | |
Callback for sending the first audio packet. | 3.0 | |
Callback for receiving the first video packet. | 3.0 | |
Callback for receiving the first audio packet. | 3.0 | |
Message that you were removed from the channel by the server or the session ended. | 3.0 | |
Real-time data callback, triggered every 2 seconds. | 3.0 | |
Callback for a remote user muting or unmuting audio. | 3.0 | |
Notification that a remote user paused or resumed sending their video stream. | 3.0 | |
Notification that a remote user stopped camera stream capture. | 3.5 | |
A remote user's application moves to the background. | 3.5 | |
A remote user's application returns to the foreground. | 3.5 | |
Data statistics for the published video stream. | 3.0 | |
Data statistics for the subscribed video stream. | 3.0 | |
Data statistics for the subscribed remote audio stream. | 3.0 | |
You can subscribe to the local audio stream. | 3.0 | |
Callback for remote user volume levels. | 3.0 | |
Callback for capture volume level. | 3.0 | |
Callback for playback volume level. | 3.0 | |
The state of the local audio device changes. | 3.4.1 | |
The state of the local video device changes. | 3.4.1 | |
Notification of a change in a remote user's video resolution. | 3.0 |
Methods
onAudioDeviceStateChanged
onAudioDeviceStateChanged(deviceId: string, deviceType: DingRtcConstants.RtcEngineDeviceType, deviceState: number): voidParameters
deviceId: stringThe device ID.
deviceType: DingRtcConstants.RtcEngineDeviceTypeThe device type.
deviceState: numberThe device state.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
The state of the local audio device has changed.
onAudioPublishStateChanged
onAudioPublishStateChanged(oldState: DingRtcConstants.RtcEnginePublishState, newState: DingRtcConstants.RtcEnginePublishState, elapseSinceLastState: number, channel: string): voidParameters
oldState: DingRtcConstants.RtcEnginePublishStateThe previous stream ingest state.
newState: DingRtcConstants.RtcEnginePublishStateThe current stream ingest state.
elapseSinceLastState: numberThe time interval between state changes, in milliseconds.
channel: stringThe current channel ID.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the audio stream ingest state changes.
onAudioRouteChanged
onAudioRouteChanged(audioRouteType: DingRtcConstants.RtcEngineAudioRouteType): voidParameters
audioRouteType: DingRtcConstants.RtcEngineAudioRouteType
Returns
voidBrief
This callback is triggered when the audio route changes.
Details
The audio route specifies whether sound is played from the phone's speaker or earpiece. A change in the audio route means the sound output location has changed.
When the audio route is the earpiece, the sound is quieter and requires you to hold the phone to your ear to hear clearly. This route provides better privacy and is suitable for phone calls.
When the audio route is the speaker, the sound is louder and can be heard without holding the phone close to your ear. This route enables a hands-free feature.
onAudioSubscribeStateChanged
onAudioSubscribeStateChanged(uid: string, oldState: DingRtcConstants.RtcEngineSubscribeState, newState: DingRtcConstants.RtcEngineSubscribeState, elapseSinceLastState: number, channel: string): voidParameters
uid: stringThe user ID. This is a unique identifier assigned by the application server.
oldState: DingRtcConstants.RtcEngineSubscribeStateThe previous subscription state.
newState: DingRtcConstants.RtcEngineSubscribeStateThe current subscription state.
elapseSinceLastState: numberThe time interval between the two state changes, in milliseconds.
channel: stringThe current channel ID.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the audio subscription state changes.
onAudioVolumeIndication
onAudioVolumeIndication(speakers: Array<DingRtcConstants.RtcAudioVolumeInfo>, speakerNumber: number): voidTypeParameters
DingRtcConstants.RtcAudioVolumeInfo
Parameters
speakers: Array<DingRtcConstants.RtcAudioVolumeInfo>If `speakers` is empty, it indicates that no remote users are sending streams or that there are no remote users in the channel. A `uid` of "0" indicates the local user.
speakerNumber: numberThe number of users.
Returns
voidSince
3.0
Brief
This callback reports the volume levels of users.
onBye
onBye(code: DingRtcConstants.RtcEngineOnByeType): voidParameters
code: DingRtcConstants.RtcEngineOnByeType.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
The server kicked you from the channel.
onChannelRemainingTimeNotify
onChannelRemainingTimeNotify(remainingTimeInSec: number): voidParameters
remainingTimeInSec: numberThe remaining duration of the channel, in seconds.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback reports the remaining duration of a channel.
onConnectionStatusChanged
onConnectionStatusChanged(status: DingRtcConstants.RtcEngineConnectionStatus, reason: DingRtcConstants.RtcEngineConnectionStatusChangeReason): voidParameters
status: DingRtcConstants.RtcEngineConnectionStatusThe current network connection state.
reason: DingRtcConstants.RtcEngineConnectionStatusChangeReasonThe reason for the change in the network connection state.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the network connection state changes.
onFirstAudioPacketReceived
onFirstAudioPacketReceived(uid: string, timeCost: number): voidParameters
uid: stringThe remote user ID. This is a unique identifier assigned by the application server.
timeCost: numberThe time elapsed, in milliseconds, from joining the session until the first audio packet is received.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the first audio packet from a remote user is received.
Details
This callback is triggered when the first audio data packet from a remote user is received.
onFirstAudioPacketSend
onFirstAudioPacketSend(timeCost: number): voidParameters
timeCost: numberThe time elapsed, in milliseconds, from joining the session until the first audio packet is sent.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the first local audio packet is sent.
Details
This callback is triggered when the first local audio data packet is sent.
onFirstLocalVideoFrameDrawn
onFirstLocalVideoFrameDrawn(width: number, height: number, elapsed: number): voidParameters
width: numberThe width of the local preview video.
height: numberThe height of the local preview video.
elapsed: numberThe total time elapsed, in milliseconds, from when the local user joined the channel until this callback is triggered.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the first frame of the local video is rendered.
Note
This callback is triggered when the first frame of the local video is rendered.
onFirstRemoteVideoFrameDrawn
onFirstRemoteVideoFrameDrawn(uid: string, videoTrack: DingRtcConstants.RtcEngineVideoTrack, width: number, height: number, elapsed: number): voidParameters
uid: stringThe user ID.
videoTrack: DingRtcConstants.RtcEngineVideoTrack.
width: numberThe video width.
height: numberThe video height.
elapsed: numberThe total time elapsed, in milliseconds, from when the local user joined the channel until this callback is triggered.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the first frame of a remote user's video is rendered.
Note
This callback is triggered when the first frame of a remote user's video is rendered.
onFirstVideoFrameReceived
onFirstVideoFrameReceived(uid: string, videoTrack: DingRtcConstants.RtcEngineVideoTrack, timeCost: number): voidParameters
uid: stringThe user ID. This is a unique identifier assigned by the application server.
videoTrack: DingRtcConstants.RtcEngineVideoTrackThe received video track.
timeCost: numberDuration (ms).
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the first video frame from a remote user is received.
Note
This callback is triggered when the first video frame from a remote user is received.
onFirstVideoPacketReceived
onFirstVideoPacketReceived(uid: string, videoTrack: DingRtcConstants.RtcEngineVideoTrack, timeCost: number): voidParameters
uid: stringThe user ID. This is a unique identifier assigned by the application server.
videoTrack: DingRtcConstants.RtcEngineVideoTrackYou can accept the video track.
timeCost: numberDuration (ms).
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the first video packet from a remote user is received.
Note
This callback is triggered when the first video packet from a remote user is received.
onFirstVideoPacketSend
onFirstVideoPacketSend(videoTrack: DingRtcConstants.RtcEngineVideoTrack, timeCost: number): voidParameters
videoTrack: DingRtcConstants.RtcEngineVideoTrackThe sent video track.
timeCost: numberDuration (ms)
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the first local video packet is sent.
Note
This callback is triggered when the first local video packet is sent.
onJoinChannelResult
onJoinChannelResult(result: number, channel: string, userId: string, elapsed: number): voidParameters
result: numberThe result of joining the channel. A value of 0 indicates success. A non-zero value indicates an error code.
channel: stringThe channel ID.
userId: stringThe user ID.
elapsed: numberThe time elapsed to join the channel, in milliseconds.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
Channel join result.
Details
After a user calls the joinChannel method, this callback is triggered to indicate whether the user has successfully joined the channel. It returns the result and the time elapsed.
onLeaveChannelResult
onLeaveChannelResult(result: number, stats: DingRtcConstants.Stats): voidParameters
result: numberThe result of leaving the channel. A value of 0 indicates success. A non-zero value indicates an error code.
stats: DingRtcConstants.StatsA summary of data statistics for the session.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
Result of leaving a channel.
Details
The SDK does not receive this callback.
onLocalAudioStats
onLocalAudioStats(localAudioStats: DingRtcConstants.LocalAudioStats): voidParameters
localAudioStats: DingRtcConstants.LocalAudioStatsLocal audio statistics.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
Local audio statistics
Note
The SDK triggers this callback periodically.
onLocalVideoStats
onLocalVideoStats(localVideoStats: DingRtcConstants.LocalVideoStats): voidParameters
localVideoStats: DingRtcConstants.LocalVideoStatsLocal video statistics.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
Statistics information of the local video.
Note
The SDK triggers this callback periodically.
onNetworkQualityChanged
onNetworkQualityChanged(uid: string, upQuality: DingRtcConstants.RtcEngineNetworkQuality, downQuality: DingRtcConstants.RtcEngineNetworkQuality): voidParameters
uid: stringThe UID of the user whose network quality has changed.
upQuality: DingRtcConstants.RtcEngineNetworkQuality.
downQuality: DingRtcConstants.RtcEngineNetworkQuality.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the network quality changes.
Note
This callback is triggered when the network quality changes. If the UID is empty, this callback reports a change in the local user's network quality.
onOccurError
onOccurError(error: number, msg: string): voidParameters
error: number.
msg: stringThe error description.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This message notifies the app of an error in the engine.
onOccurWarning
onOccurWarning(warn: number, msg: string): voidParameters
warn: numberThe warning type.
msg: stringThe warning message.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This message notifies the application when the engine generates a warning.
onPlayoutDeviceAudioLevel
onPlayoutDeviceAudioLevel(level: number): voidParameters
level: numberThe volume level of the audio playback device. The value ranges from 0 to 100.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback reports the volume level of the audio playback device.
onRecordingDeviceAudioLevel
onRecordingDeviceAudioLevel(level: number): voidParameters
level: numberThe volume level of the audio capture device. The value ranges from 0 to 100.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback reports the volume level of the audio capture device.
onRemoteAudioStats
onRemoteAudioStats(remoteAudioStats: DingRtcConstants.RemoteAudioStats): voidParameters
remoteAudioStats: DingRtcConstants.RemoteAudioStatsRemote audio statistics.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
Provides statistics for remote audio.
Note
The SDK triggers this callback periodically.
onRemoteTrackAvailableNotify
onRemoteTrackAvailableNotify(uid: string, audioTrack: DingRtcConstants.RtcEngineAudioTrack, videoTrack: DingRtcConstants.RtcEngineVideoTrack): voidParameters
uid: stringThe user ID. This is a unique identifier assigned by the application server.
audioTrack: DingRtcConstants.RtcEngineAudioTrack.
videoTrack: DingRtcConstants.RtcEngineVideoTrack.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the availability of a remote user's audio or video stream changes.
Details
This callback is triggered in the following scenarios:
A remote user starts to send an audio or video stream.
A remote user stops sending an audio or video stream.
onRemoteUserOffLineNotify
onRemoteUserOffLineNotify(uid: string, reason: DingRtcConstants.UserOfflineReason): voidParameters
uid: stringThe user ID. This is a unique identifier assigned by the application server.
reason: DingRtcConstants.UserOfflineReason.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when a remote user leaves the channel.
onRemoteUserOnLineNotify
onRemoteUserOnLineNotify(uid: string, elapsed: number): voidParameters
uid: stringThe user ID. This is a unique identifier assigned by the application server.
elapsed: numberThe time elapsed for the user to join the channel.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when a remote user joins the channel.
onRemoteVideoStats
onRemoteVideoStats(remoteVideoStats: DingRtcConstants.RemoteVideoStats): voidParameters
remoteVideoStats: DingRtcConstants.RemoteVideoStatsRemote video statistics.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
Statistics for remote video.
Note
The SDK triggers this callback periodically.
onRenderLocalVideoSizeChanged
onRenderLocalVideoSizeChanged(videoTrack: DingRtcConstants.RtcEngineVideoTrack, newWidth: number, newHeight: number, oldWidth: number, oldHeight: number): voidParameters
videoTrack: DingRtcConstants.RtcEngineVideoTrackThe local video track.
newWidth: numberThe new video width after the change.
newHeight: numberThe new video height after the change.
oldWidth: numberThe old video width before the change.
oldHeight: numberThe old video height before the change.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.2.1
Brief
This callback is triggered when the resolution of the local video renderer changes.
Note
The rendered video size may differ from the captured video size if post-processing, such as scaling, is applied after capture.
onRenderRemoteVideoSizeChanged
onRenderRemoteVideoSizeChanged(uid: string, videoTrack: DingRtcConstants.RtcEngineVideoTrack, newWidth: number, newHeight: number, oldWidth: number, oldHeight: number): voidParameters
uid: stringThe user ID. This is a unique identifier assigned by the application server.
videoTrack: DingRtcConstants.RtcEngineVideoTrackThe received video track.
newWidth: numberThe new video width after the change.
newHeight: numberThe new video height after the change.
oldWidth: numberThe old video width before the change.
oldHeight: numberThe old video height before the change.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.2.1
Brief
This callback is triggered when the resolution of a remote video renderer changes.
Note
The rendered video size may differ from the decoder output size if video post-processing features, such as super resolution, are used.
Note
Due to features such as simulcast, dynamic resolution adjustment, and orientation changes, the rendered video size may differ from the maximum stream ingest resolution set by the remote user.
onScreenSharePublishStateChanged
onScreenSharePublishStateChanged(oldState: DingRtcConstants.RtcEnginePublishState, newState: DingRtcConstants.RtcEnginePublishState, elapseSinceLastState: number, channel: string): voidParameters
oldState: DingRtcConstants.RtcEnginePublishStateThe previous stream ingest state.
newState: DingRtcConstants.RtcEnginePublishStateThe current stream ingest state.
elapseSinceLastState: numberThe time interval between state changes, in milliseconds.
channel: stringThe current channel ID.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the screen sharing stream ingest state changes.
onScreenShareSubscribeStateChanged
onScreenShareSubscribeStateChanged(uid: string, oldState: DingRtcConstants.RtcEngineSubscribeState, newState: DingRtcConstants.RtcEngineSubscribeState, elapseSinceLastState: number, channel: string): voidParameters
uid: stringThe user ID. This is a unique identifier assigned by the application server.
oldState: DingRtcConstants.RtcEngineSubscribeStateThe previous subscription state.
newState: DingRtcConstants.RtcEngineSubscribeStateThe current subscription state.
elapseSinceLastState: numberThe time interval between the two state changes, in milliseconds.
channel: stringThe current channel ID.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the screen sharing stream subscription state changes.
onSnapshotComplete
onSnapshotComplete(uid: string, videoTrack: DingRtcConstants.RtcEngineVideoTrack, filePath: string, width: number, height: number, success: boolean): voidParameters
uid: stringThe user ID. An empty string indicates the local user.
videoTrack: DingRtcConstants.RtcEngineVideoTrack.
filePath: stringThe local path where the snapshot is saved.
width: numberThe snapshot width.
height: numberThe snapshot height.
success: booleanIndicates whether the snapshot was taken successfully.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback reports the result of a video snapshot.
Note
This API handles screenshot callbacks.
onStats
onStats(stats: DingRtcConstants.Stats): voidParameters
stats: DingRtcConstants.StatsSession statistics.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback reports the current session statistics.
Note
The SDK triggers this callback periodically.
onSubscribeStreamTypeChanged
onSubscribeStreamTypeChanged(uid: string, oldStreamType: DingRtcConstants.RtcEngineVideoStreamType, newStreamType: DingRtcConstants.RtcEngineVideoStreamType, elapseSinceLastState: number, channel: string): voidParameters
uid: stringThe user ID. This is a unique identifier assigned by the application server.
oldStreamType: DingRtcConstants.RtcEngineVideoStreamTypeThe previously subscribed video stream type.
newStreamType: DingRtcConstants.RtcEngineVideoStreamTypeThe currently subscribed video stream type.
elapseSinceLastState: numberThe time interval between video stream type changes, in milliseconds.
channel: stringThe current channel ID.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the subscribed video stream type changes.
Note
Subscribing to a specific video stream type does not guarantee that you will receive that stream. The actual received stream type depends on the remote user's stream ingest and network conditions.
onUserAudioMuted
onUserAudioMuted(uid: string, isMute: boolean): voidParameters
uid: stringThe remote user ID.
isMute: booleanIndicates whether the user is muted.
true: The user is muted.
false: The user is unmuted.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when a remote user mutes or unmutes their audio.
onUserVideoEnabled
onUserVideoEnabled(uid: string, enabled: boolean): voidParameters
uid: stringThe remote user ID.
enabled: boolean- true: Enables camera stream capture. - false: Disables camera stream capture.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.5
Brief
The remote user has stopped the camera stream.
onUserVideoMuted
onUserVideoMuted(uid: string, isMute: boolean, videoTrack: DingRtcConstants.RtcEngineVideoTrack): voidParameters
uid: stringThe remote user ID.
isMute: boolean- true: The user paused sending their video stream. - false: The user resumed sending their video stream.videoTrack: DingRtcConstants.RtcEngineVideoTrack.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when a remote user pauses or resumes sending their video stream.
onUserWillBecomeActive
onUserWillBecomeActive(uid: string): voidParameters
uid: stringThe remote user ID.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.5
Brief
The remote user's application is brought to the foreground.
onUserWillResignActive
onUserWillResignActive(uid: string): voidParameters
uid: stringThe remote user ID.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.5
Brief
The remote user's application enters the background.
onVideoDeviceStateChanged
onVideoDeviceStateChanged(deviceId: string, deviceType: DingRtcConstants.RtcEngineDeviceType, deviceState: number): voidParameters
deviceId: stringThe camera ID.
deviceType: DingRtcConstants.RtcEngineDeviceTypeThe device type.
deviceState: numberThe device state.
Returns
voidBrief
The status of the local camera changes.
Since
3.4.1
onVideoPublishStateChanged
Parameters
oldState: DingRtcConstants.RtcEnginePublishStateThe previous stream ingest state.
newState: DingRtcConstants.RtcEnginePublishStateThe current stream ingest state.
elapseSinceLastState: numberThe time interval between state changes, in milliseconds.
channel: stringThe current channel ID.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the video stream ingest state changes.
onVideoSubscribeStateChanged
onVideoSubscribeStateChanged(uid: string, oldState: DingRtcConstants.RtcEngineSubscribeState, newState: DingRtcConstants.RtcEngineSubscribeState, elapseSinceLastState: number, channel: string): voidParameters
uid: stringThe user ID. This is a unique identifier assigned by the application server.
oldState: DingRtcConstants.RtcEngineSubscribeStateThe previous subscription state.
newState: DingRtcConstants.RtcEngineSubscribeStateThe current subscription state.
elapseSinceLastState: numberThe time interval between the two state changes, in milliseconds.
channel: stringThe current channel ID.
Returns
voidIngroup
OHOS_DingRtcCallbackEventListener
Since
3.0
Brief
This callback is triggered when the camera stream subscription state changes.