onSubtitleStateChanged method
FutureOr<void>
onSubtitleStateChanged(
- dynamic state,
- dynamic errorCode,
- dynamic errorMessage
override
@hidden currently not available
@detail callback
@author qiaoxingwang
@brief Callback on subtitle states.
After you call startSubtitle{@link #RTCRoom#startSubtitle} and stopSubtitle{@link #RTCRoom#stopSubtitle}, you will receive this callback which informs you of the states and error codes of the subtitling task, as well as detailed information on the third party services' errors.
@param state The states of subtitles. Refer to SubtitleState{@link #SubtitleState} for details.
@param errorCode Error codes of the subtitling task. Refer to SubtitleErrorCode{@link #SubtitleErrorCode}.
@param errorMessage Detailed information on the third party services' errors.
Implementation
FutureOr<void> onSubtitleStateChanged(
dynamic state, dynamic errorCode, dynamic errorMessage) async {
if ($instance == null || $instance is! IRTCRoomEventHandler) {
return;
}
return ($instance as IRTCRoomEventHandler).onSubtitleStateChanged?.call(
t_SubtitleState.android_to_code($p_a.SubtitleState.values
.firstWhere((t) => t.$value == state || t.name == state)),
t_SubtitleErrorCode.android_to_code($p_a.SubtitleErrorCode.values
.firstWhere((t) => t.$value == errorCode || t.name == errorCode)),
errorMessage.toString());
}