RTCMediaEvent carries the media events of one channel. RTCEngine.setRtcMediaEvent(...) sets the listener for the default channel; for additional channels, use RTCChannel.setRtcMediaEvent(...). If you only care about a few events, extend RTCMediaSimpleEvent.
The first parameter of every callback is channel: String, which identifies which channel the event belongs to in multi-channel scenarios.
Interface methods
onMediaConnected(channel)
onRemoteVideoFrame(channel, uid, trackDesc, y, u, v, width, height, format, angle)
uid and trackDesc identify the remote track; y, u, and v are the image components, width / height are the dimensions, format is the pixel format, and angle is the rotation angle.
onMediaMetric(channel, metric)
onNetworkQualityChanged(channel, change)
trend is STABLE. The SDK doesn’t check for level crossings or debounce, so debounce yourself if needed. The callback runs on an SDK background thread, so switch to the main thread before updating the UI. For usage, see Network quality.
onVolumesReport(channel, volumes)
onActiveSpeakersChanged(channel, speakers)
RTCMediaEvent to RTCCameraDeviceEvent and aren’t reported repeatedly because of multiple channels. Local video frames and local audio frames also use their own separate listeners.
:::