getNetworkTimeInfo method
@detail api
@author songxiaomeng.19
@brief Obtain the synchronization network time information.
@return See NetworkTimeInfo{@link #NetworkTimeInfo}.
@note
- When you call this API for the first time, you starts synchornizing the network time information and receive the return value 0. After the synchonization finishes, you will receive onNetworkTimeSynchronized{@link #IRTCEngineEventHandler#onNetworkTimeSynchronized}. After that, calling this API will get you the correct network time.
- Under chorus scenario, participants shall start audio mixing at the same network time.
Implementation
Future<NetworkTimeInfo?> getNetworkTimeInfo() async {
$a() async {
final instance = await ($instance as $p_a.RTCEngine).getNetworkTimeInfo();
return packObject(
instance,
() async => NetworkTimeInfo.fromMap(
NetworkTimeInfo.deepPackedMapValues(
NetworkTimeInfo.mapMemberToConstructorParams(
await instance.sendInstancePropertiesGet(instance)))));
}
;
$i() async {
final instance =
await ($instance as $p_i.ByteRTCEngine).getNetworkTimeInfo();
return packObject(
instance,
() async => NetworkTimeInfo.fromMap(
NetworkTimeInfo.deepPackedMapValues(
NetworkTimeInfo.mapMemberToConstructorParams(
await instance.sendInstancePropertiesGet(instance)))));
}
;
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}