Merge pull request #12368 from prlanzarin/u23-eole
fix(video): check if encodings array is empty before trying to apply bitrate
This commit is contained in:
commit
6f9096f410
@ -280,8 +280,7 @@ class VideoProvider extends Component {
|
||||
this.disconnectStreams(streamsToDisconnect);
|
||||
|
||||
if (CAMERA_QUALITY_THRESHOLDS_ENABLED) {
|
||||
const floorStream = streams.find(vs => vs.floor === true);
|
||||
this.updateThreshold(this.props.totalNumberOfStreams, floorStream);
|
||||
this.updateThreshold(this.props.totalNumberOfStreams);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -691,11 +691,14 @@ class VideoService {
|
||||
const { track } = sender;
|
||||
if (track && track.kind === 'video') {
|
||||
const parameters = sender.getParameters();
|
||||
if (!parameters.encodings) {
|
||||
const normalizedBitrate = bitrate * 1000;
|
||||
|
||||
// The encoder parameters might not be up yet; if that's the case,
|
||||
// add a filler object so we can alter the parameters anyways
|
||||
if (parameters.encodings == null || parameters.encodings.length === 0) {
|
||||
parameters.encodings = [{}];
|
||||
}
|
||||
|
||||
const normalizedBitrate = bitrate * 1000;
|
||||
// Only reset bitrate if it changed in some way to avoid enconder fluctuations
|
||||
if (parameters.encodings[0].maxBitrate !== normalizedBitrate) {
|
||||
parameters.encodings[0].maxBitrate = normalizedBitrate;
|
||||
|
Loading…
Reference in New Issue
Block a user