enableSwitchPlaybackQuality method

void enableSwitchPlaybackQuality(
  1. bool enable
)

Implementation

void enableSwitchPlaybackQuality(bool enable) async {
  Map<String, dynamic> config = {
    'key': 'Liteav.engine.set.live.qos.audience.strategy.version"',
    'value': enable ? 1 : 0
  };

  Map<String, dynamic> params = {
    'configs': [config]
  };
  Map<String, dynamic> jsonObject = {'api': 'setPrivateConfig', 'params': params};

  try {
    final jsonString = json.encode(jsonObject);
    final trtc = await TRTCCloud.sharedInstance();
    trtc.callExperimentalAPI(jsonString);
  } catch (e) {
    LiveKitLogger.error('Error enableSwitchPlaybackQuality');
  }
}