Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Ensure that we have a non-null codecId when we try to update the pref…
Browse files Browse the repository at this point in the history
…erred codec (#400)
  • Loading branch information
Belchy06 authored Oct 19, 2023
1 parent bf6dcad commit 2a21ee6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class PeerConnectionController {
this.onVideoStats(this.aggregatedStats);

// Update the preferred codec selection based on what was actually negotiated
if (this.updateCodecSelection) {
if (this.updateCodecSelection && !!this.aggregatedStats.inboundVideoStats.codecId) {
this.config.setOptionSettingValue(
OptionParameters.PreferredCodec,
this.aggregatedStats.codecs.get(
Expand Down Expand Up @@ -370,7 +370,7 @@ export class PeerConnectionController {
if (RTCRtpReceiver.getCapabilities && this.preferredCodec != '') {
for (const transceiver of this.peerConnection?.getTransceivers() ?? []) {
if (
transceiver &&
transceiver &&
transceiver.receiver &&
transceiver.receiver.track &&
transceiver.receiver.track.kind === 'video' &&
Expand Down

0 comments on commit 2a21ee6

Please sign in to comment.