createRTCEngine static method
FutureOr<ByteRTCEngine>
createRTCEngine(
- ByteRTCEngineConfig config,
- id<
ByteRTCEngineDelegate> delegate
@detail api
@author wangzhanqiang
@brief Creates an engine instance.
This is the very first API that you must call if you want to use all the RTC capabilities.
If there is no engine instance in current process, calling this API will create one. If an engine instance has been created, calling this API again will have the created engine instance returned.
@param config ByteRTCEngineConfig{@link #ByteRTCEngineConfig}
@param delegate Delegate sent from SDK to App. See ByteRTCEngineDelegate{@link #ByteRTCEngineDelegate}
@return A ByteRTCEngine{@link #ByteRTCEngine} instance
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;
}
}