initRtcEngine method
Future<int>
initRtcEngine(
{ - required NERtcChannelEventCallback rtcChannelEventCallback,
- bool attendeeRecordOn = false,
- required MediaType mediaType,
- required String nrtcAppKey,
})
Implementation
Future<int> initRtcEngine({
required NERtcChannelEventCallback rtcChannelEventCallback,
bool attendeeRecordOn = false,
required MediaType mediaType,
required String nrtcAppKey,
}) async {
if (_isInit) {
if (_currentMediaType == mediaType) {
return NERtcErrorCode.ok;
} else {
if (_currentMediaType == MediaType.inRoom) return NERtcErrorCode.ok;
await engine.release();
_isInit = !_isInit;
}
}
var options = getOption(attendeeRecordOn);
var result = await engine.create(
appKey:nrtcAppKey,
channelEventCallback: rtcChannelEventCallback,
options: options,
);
_isInit = result == NERtcErrorCode.ok;
_currentMediaType = mediaType;
return result;
}