|
|
@@ -569,15 +569,20 @@ const SDPUtil = {
|
|
569
|
569
|
* that is found.
|
|
570
|
570
|
* @param {object} videoMLine the video mline object from
|
|
571
|
571
|
* an sdp as parsed by transform.parse
|
|
572
|
|
- * @param {string} the name of the preferred codec
|
|
|
572
|
+ * @param {string} codecName the name of the preferred codec
|
|
573
|
573
|
*/
|
|
574
|
574
|
preferVideoCodec(videoMLine, codecName) {
|
|
575
|
575
|
let payloadType = null;
|
|
576
|
576
|
|
|
|
577
|
+ if (!codecName) {
|
|
|
578
|
+ return;
|
|
|
579
|
+ }
|
|
|
580
|
+
|
|
577
|
581
|
for (let i = 0; i < videoMLine.rtp.length; ++i) {
|
|
578
|
582
|
const rtp = videoMLine.rtp[i];
|
|
579
|
583
|
|
|
580
|
|
- if (rtp.codec === codecName) {
|
|
|
584
|
+ if (rtp.codec
|
|
|
585
|
+ && rtp.codec.toLowerCase() === codecName.toLowerCase()) {
|
|
581
|
586
|
payloadType = rtp.payload;
|
|
582
|
587
|
break;
|
|
583
|
588
|
}
|