rtcEngine$onRemoteVideoStateChanged$info$withVideoState$withVideoStateReason method
FutureOr<void>
rtcEngine$onRemoteVideoStateChanged$info$withVideoState$withVideoStateReason(
- dynamic engine,
- dynamic streamId,
- dynamic info,
- dynamic state,
- dynamic reason,
override
@detail callback @author shenpengliang @brief When the state of the remote video stream changes, users in the room who subscribe to this stream will receive the event. @param engine ByteRTCEngine object @param streamId ID of Remote stream. @param info Remote stream information. See ByteRTCStreamInfo{@link #ByteRTCStreamInfo}. @param state The current state of the remote video stream. See ByteRTCRemoteVideoState{@link #ByteRTCRemoteVideoState} @param reason The reason for the change in the state of the remote video stream. See ByteRTCRemoteVideoStateChangeReason{@link #ByteRTCRemoteVideoStateChangeReason} @note This callback is only applicable to the main stream and not applicable to the screen stream.
Implementation
FutureOr<void>
rtcEngine$onRemoteVideoStateChanged$info$withVideoState$withVideoStateReason(
dynamic engine,
dynamic streamId,
dynamic info,
dynamic state,
dynamic reason) async {
if ($instance == null || $instance is! IRTCEngineEventHandler) {
return;
}
return ($instance as IRTCEngineEventHandler)
.onRemoteVideoStateChanged
?.call(
streamId.toString(),
packObject(
info,
() => StreamInfo.fromMap(StreamInfo.deepPackedMapValues(
StreamInfo.mapMemberToConstructorParams(info)))),
t_RemoteVideoState.ios_to_code($p_i.ByteRTCRemoteVideoState.values
.firstWhere((t) => t.$value == state || t.name == state)),
t_RemoteVideoStateChangeReason.ios_to_code($p_i
.ByteRTCRemoteVideoStateChangeReason.values
.firstWhere((t) => t.$value == reason || t.name == reason)));
}