Skip to content

Commit

Permalink
ios: fix setCodecPreferences build error
Browse files Browse the repository at this point in the history
  • Loading branch information
davidliu committed Nov 1, 2023
1 parent eb2b0c4 commit 93bfe02
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ios/RCTWebRTC/WebRTCModule+Transceivers.m
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ @implementation WebRTCModule (Transceivers)
}

if (transceiver == nil) {
RCTLogWarn(@"senderSetParameters() transceiver is null");
RCTLogWarn(@"transceiverSetCodecPreferences() transceiver is null");
return nil;
}

// Convert JSON codec capabilities to the actual objects.
// Get the available codecs
RTCRtpTransceiverDirection direction = transceiver.direction;
NSMutableArray *availableCodecs = [NSMutableArray new];
if (direction == RTCRtpTransceiverDirectionSendRecv || direction == RTCRtpTransceiverDirectionSendOnly) {
Expand All @@ -233,7 +233,8 @@ @implementation WebRTCModule (Transceivers)
}];
}
}


// Convert JSON codec capabilities to the actual objects.
// Codec preferences is order sensitive.
NSMutableArray *codecsToSet = [NSMutableArray new];

Expand All @@ -247,7 +248,7 @@ @implementation WebRTCModule (Transceivers)
}
}

transceiver.codecPreferences = codecsToSet;
[transceiver setCodecPreferences:codecsToSet];
return nil;
}

Expand Down

0 comments on commit 93bfe02

Please sign in to comment.