setCacheParams method

Future<int> setCacheParams(
  1. double minTime,
  2. double maxTime
)

Set the minimum and maximum time for automatic adjustment of player cache (unit: seconds)

@param minTime The minimum time for automatic cache adjustment, which must be greater than 0. Default: 1. @param maxTime The maximum time for automatic cache adjustment, which must be greater than 0. Default: 5. @return The return value {@link V2TXLiveCode}. - 0: Success. - -2: Operation failed, minTime and maxTime need to be greater than 0. - -3: The player is in playback state and does not support modifying cache policy.

设置播放器缓存自动调整的最小和最大时间 ( 单位:秒 )

@param minTime 缓存自动调整的最小时间,取值需要大于0。【默认值】:1。 @param maxTime 缓存自动调整的最大时间,取值需要大于0。【默认值】:5。 @return 返回值 {@link V2TXLiveCode}。 - 0: 成功。 - -2: 操作失败,minTime 和 maxTime 需要大于0。 - -3: 播放器处于播放状态,不支持修改缓存策略。

Implementation

Future<int> setCacheParams(double minTime, double maxTime) async {
  if (_isNeedDisposed) return -1;
  await _initPlayer.future;
  return await _livePlayerApi.setCacheParams(PlayerMsg(playerId: _playerId), minTime, maxTime);
}