createRTCEngine static method
FutureOr<ByteRTCEngine>
createRTCEngine(
- ByteRTCEngineConfig config,
- id<
ByteRTCEngineDelegate> delegate
@detail api
@author wangzhanqiang
@brief 创建引擎对象。
如果当前进程中未创建引擎实例,那么你必须先使用此方法,以使用 RTC 提供的各种音视频能力。
如果当前进程中已创建了引擎实例,再次调用此方法时,会返回已创建的引擎实例。
@param config 创建引擎参数配置,详见 ByteRTCEngineConfig{@link #ByteRTCEngineConfig}
@param delegate SDK 回调给应用层的 delegate,详见 ByteRTCEngineDelegate{@link #ByteRTCEngineDelegate}
@return 可用的 ByteRTCEngine{@link #ByteRTCEngine} 实例
Implementation
static FutureOr<ByteRTCEngine> createRTCEngine(
ByteRTCEngineConfig config, id<ByteRTCEngineDelegate> delegate) async {
try {
final result = await NativeClassUtils.nativeStaticCall(
_$namespace,
'createRTCEngine:delegate:',
[config, delegate],
'com.volcengine.rtc.hybrid_runtime',
);
return packObject(result,
() => ByteRTCEngine(const NativeClassOptions([], disableInit: true)));
} catch (e) {
rethrow;
}
}