setTargetBitrate method

void setTargetBitrate(
  1. int newBps
)

Change the target bitrate at runtime. Useful for ABR drivers reacting to network feedback. The leaky bucket is NOT reset — existing drift propagates into the new operating point so the controller smoothly transitions. Throws if newBps <= 0.

Implementation

void setTargetBitrate(int newBps) {
  if (newBps <= 0) {
    throw ArgumentError('targetBitrateBps must be > 0 (got $newBps)');
  }
  _targetBitrateBps = newBps;
}