From b546b39123c05dc10212dd66618d10f699cd5f1e Mon Sep 17 00:00:00 2001 From: t-mullen Date: Wed, 14 Jul 2021 12:06:52 -0400 Subject: [PATCH 1/2] feat: implement setting per-encoding rtpEncodingParameters --- lib/Producer.d.ts | 2 +- lib/Producer.d.ts.map | 2 +- lib/handlers/Chrome67.d.ts.map | 2 +- lib/handlers/Chrome67.js | 13 ++++++++++--- lib/handlers/Chrome70.d.ts.map | 2 +- lib/handlers/Chrome70.js | 13 ++++++++++--- lib/handlers/Chrome74.d.ts.map | 2 +- lib/handlers/Chrome74.js | 13 ++++++++++--- lib/handlers/Edge11.d.ts.map | 2 +- lib/handlers/Edge11.js | 13 ++++++++++--- lib/handlers/Firefox60.d.ts.map | 2 +- lib/handlers/Firefox60.js | 14 +++++++++++--- lib/handlers/Safari11.d.ts.map | 2 +- lib/handlers/Safari11.js | 13 ++++++++++--- lib/handlers/Safari12.d.ts.map | 2 +- lib/handlers/Safari12.js | 13 ++++++++++--- src/Producer.ts | 2 +- src/handlers/Chrome67.ts | 16 +++++++++++++--- src/handlers/Chrome70.ts | 16 +++++++++++++--- src/handlers/Chrome74.ts | 16 +++++++++++++--- src/handlers/Edge11.ts | 16 +++++++++++++--- src/handlers/Firefox60.ts | 17 ++++++++++++++--- src/handlers/Safari11.ts | 16 +++++++++++++--- src/handlers/Safari12.ts | 16 +++++++++++++--- test/test.js | 9 +++++++++ 25 files changed, 182 insertions(+), 52 deletions(-) diff --git a/lib/Producer.d.ts b/lib/Producer.d.ts index 27391ef2..13ac5a4d 100644 --- a/lib/Producer.d.ts +++ b/lib/Producer.d.ts @@ -144,7 +144,7 @@ export declare class Producer extends EnhancedEventEmitter { /** * Sets the DSCP value. */ - setRtpEncodingParameters(params: RTCRtpEncodingParameters): Promise; + setRtpEncodingParameters(params: RTCRtpEncodingParameters | RTCRtpEncodingParameters[]): Promise; private _onTrackEnded; private _handleTrack; private _destroyTrack; diff --git a/lib/Producer.d.ts.map b/lib/Producer.d.ts.map index 07385d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C;IAsDhF;;OAEG;IACG,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB7D;;OAEG;IACG,wBAAwB,CAC7B,MAAM,EAAE,wBAAwB,GAAG,wBAAwB,EAAE,GAC3D,OAAO,CAAC,IAAI,CAAC;IAUhB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,aAAa;CAgBrB"} \ No newline at end of file diff --git a/lib/handlers/Chrome67.d.ts.map b/lib/handlers/Chrome67.d.ts.map index d13aa04a..77f587db 100644 --- a/lib/handlers/Chrome67.d.ts.map +++ b/lib/handlers/Chrome67.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Chrome67.d.ts","sourceRoot":"","sources":["../../src/handlers/Chrome67.ts"],"names":[],"mappings":"AAMA,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAY,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,eAAe,EAAiB,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAwB,MAAM,mBAAmB,CAAC;AAM3E,qBAAa,QAAS,SAAQ,gBAAgB;IAG7C,OAAO,CAAC,UAAU,CAAC,CAAkB;IAErC,OAAO,CAAC,UAAU,CAAC,CAAY;IAE/B,OAAO,CAAC,2BAA2B,CAAC,CAAmC;IAGvE,OAAO,CAAC,iCAAiC,CAAC,CAAmC;IAE7E,OAAO,CAAC,GAAG,CAAM;IAEjB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IAEjD,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAC9B;IAEX,OAAO,CAAC,gBAAgB,CAAK;IAG7B,OAAO,CAAC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,CAAC,IAAI,CAAC;IA0BxE,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAiCrE,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAYxD,eAAe,CACpB,EACC,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,QAAQ,EACR,EAAE,6BAA6B,GAC9B,OAAO,CAAC,4BAA4B,CAAC;IAiElC,OAAO,CACZ,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,qBAAqB,GACrD,OAAO,CAAC,oBAAoB,CAAC;IAkE1B,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA+B7C,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAY1D,kBAAkB,CACvB,EAAE,oBAAoB,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,gCAAgC,GACzE,OAAO,CAAC,+BAA+B,CAAC;YA6D7B,eAAe;IA+B7B,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,oBAAoB;CAQ5B"} \ No newline at end of file diff --git a/lib/handlers/Chrome67.js b/lib/handlers/Chrome67.js index d689f362..2eb3309f 100644 --- a/lib/handlers/Chrome67.js +++ b/lib/handlers/Chrome67.js @@ -329,9 +329,16 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface { if (!rtpSender) throw new Error('associated RTCRtpSender not found'); const parameters = rtpSender.getParameters(); - parameters.encodings.forEach((encoding, idx) => { - parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params); - }); + if (Array.isArray(params)) { + parameters.encodings.forEach((encoding, idx) => { + parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params[idx]); + }); + } + else { + parameters.encodings.forEach((encoding, idx) => { + parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params); + }); + } await rtpSender.setParameters(parameters); } async getSenderStats(localId) { diff --git a/lib/handlers/Chrome70.d.ts.map b/lib/handlers/Chrome70.d.ts.map index 24960fd8..3493d0ba 100644 --- a/lib/handlers/Chrome70.d.ts.map +++ b/lib/handlers/Chrome70.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Chrome70.d.ts","sourceRoot":"","sources":["../../src/handlers/Chrome70.ts"],"names":[],"mappings":"AAMA,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,aAAa,EAAY,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,eAAe,EAAiB,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAwB,MAAM,mBAAmB,CAAC;AAM3E,qBAAa,QAAS,SAAQ,gBAAgB;IAG7C,OAAO,CAAC,UAAU,CAAC,CAAkB;IAErC,OAAO,CAAC,UAAU,CAAC,CAAY;IAE/B,OAAO,CAAC,2BAA2B,CAAC,CAAmC;IAGvE,OAAO,CAAC,iCAAiC,CAAC,CAAmC;IAE7E,OAAO,CAAC,GAAG,CAAM;IAEjB,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CACxB;IAEX,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IAEjD,OAAO,CAAC,2BAA2B,CAAS;IAE5C,OAAO,CAAC,qBAAqB,CAAK;IAElC,OAAO,CAAC,eAAe,CAAS;IAEhC;;OAEG;IACH,MAAM,CAAC,aAAa,IAAI,cAAc;;IAUtC,IAAI,IAAI,IAAI,MAAM,CAGjB;IAED,KAAK,IAAI,IAAI;IAYP,wBAAwB,IAAI,OAAO,CAAC,eAAe,CAAC;IAsCpD,yBAAyB,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAS5D,GAAG,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1B,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA8B7C,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAY1D,kBAAkB,CACvB,EAAE,oBAAoB,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,gCAAgC,GACzE,OAAO,CAAC,+BAA+B,CAAC;YA6D7B,eAAe;IA+B7B,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,oBAAoB;CAQ5B"} \ No newline at end of file diff --git a/lib/handlers/Chrome70.js b/lib/handlers/Chrome70.js index 79e511fa..bea787fd 100644 --- a/lib/handlers/Chrome70.js +++ b/lib/handlers/Chrome70.js @@ -335,9 +335,16 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface { if (!transceiver) throw new Error('associated RTCRtpTransceiver not found'); const parameters = transceiver.sender.getParameters(); - parameters.encodings.forEach((encoding, idx) => { - parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params); - }); + if (Array.isArray(params)) { + parameters.encodings.forEach((encoding, idx) => { + parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params[idx]); + }); + } + else { + parameters.encodings.forEach((encoding, idx) => { + parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params); + }); + } await transceiver.sender.setParameters(parameters); } async getSenderStats(localId) { diff --git a/lib/handlers/Chrome74.d.ts.map b/lib/handlers/Chrome74.d.ts.map index d140e939..18d859c6 100644 --- a/lib/handlers/Chrome74.d.ts.map +++ b/lib/handlers/Chrome74.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Chrome74.d.ts","sourceRoot":"","sources":["../../src/handlers/Chrome74.ts"],"names":[],"mappings":"AAMA,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/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 b/lib/handlers/Chrome74.js @@ -326,9 +326,16 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface { if (!transceiver) throw new Error('associated RTCRtpTransceiver not found'); const parameters = transceiver.sender.getParameters(); - parameters.encodings.forEach((encoding, idx) => { - parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params); - }); + if (Array.isArray(params)) { + parameters.encodings.forEach((encoding, idx) => { + parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params[idx]); + }); + } + else { + parameters.encodings.forEach((encoding, idx) => { + parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params); + }); + } await transceiver.sender.setParameters(parameters); } async getSenderStats(localId) { diff --git a/lib/handlers/Edge11.d.ts.map b/lib/handlers/Edge11.d.ts.map index b46f3e7d..9f808737 100644 --- a/lib/handlers/Edge11.d.ts.map +++ b/lib/handlers/Edge11.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Edge11.d.ts","sourceRoot":"","sources":["../../src/handlers/Edge11.ts"],"names":[],"mappings":"AAKA,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,aAAa,EAIb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAiB,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAIrD,qBAAa,MAAO,SAAQ,gBAAgB;IAG3C,OAAO,CAAC,2BAA2B,CAAC,CAAmC;IAEvE,OAAO,CAAC,oBAAoB,CAAC,CAAgB;IAE7C,OAAO,CAAC,oBAAoB,CAAC,CAAiB;IAE9C,OAAO,CAAC,qBAAqB,CAAC,CAAiB;IAE/C,OAAO,CAAC,YAAY,CAAC,CAAM;IAE3B,OAAO,CAAC,a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YAAY,CACjB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAC7C,OAAO,CAAC,IAAI,CAAC;IAoBV,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBxE,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IA+BrE,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAUxD,eAAe,CAEpB,OAAO,EAAE,6BAA6B,GACpC,OAAO,CAAC,4BAA4B,CAAC;IAKlC,OAAO,CACZ,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,qBAAqB,GACrD,OAAO,CAAC,oBAAoB,CAAC;IAuC1B,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuB7C,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAU1D,kBAAkB,CAEvB,OAAO,EAAE,gCAAgC,GACvC,OAAO,CAAC,+BAA+B,CAAC;IAK3C,OAAO,CAAC,eAAe;IA8BvB,OAAO,CAAC,gBAAgB;IA6DxB,OAAO,CAAC,iBAAiB;YA6BX,eAAe;CA+C7B"} \ No newline at end of file diff --git a/lib/handlers/Edge11.js b/lib/handlers/Edge11.js index 069c5a74..d7cf1772 100644 --- a/lib/handlers/Edge11.js +++ b/lib/handlers/Edge11.js @@ -216,9 +216,16 @@ class Edge11 extends HandlerInterface_1.HandlerInterface { if (!rtpSender) throw new Error('RTCRtpSender not found'); const parameters = rtpSender.getParameters(); - parameters.encodings.forEach((encoding, idx) => { - parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params); - }); + if (Array.isArray(params)) { + parameters.encodings.forEach((encoding, idx) => { + parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params[idx]); + }); + } + else { + parameters.encodings.forEach((encoding, idx) => { + parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params); + }); + } await rtpSender.setParameters(parameters); } async getSenderStats(localId) { diff --git a/lib/handlers/Firefox60.d.ts.map b/lib/handlers/Firefox60.d.ts.map index 10109002..f134098a 100644 --- a/lib/handlers/Firefox60.d.ts.map +++ b/lib/handlers/Firefox60.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Firefox60.d.ts","sourceRoot":"","sources":["../../src/handlers/Firefox60.ts"],"names":[],"mappings":"AAOA,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAY,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,eAAe,EAAiB,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAwB,MAAM,mBAAmB,CAAC;AAM3E,qBAAa,SAAU,SAAQ,gBAAgB;IAG9C,OAAO,CAAC,UAAU,CAAC,CAAkB;IAErC,OAAO,CAAC,UAAU,CAAC,CAAY;IAE/B,OAAO,CAAC,2BAA2B,CAAC,CAAmC;IAGvE,OAAO,CAAC,iCAAiC,CAAC,CAAmC;IAE7E,OAAO,CAAC,GAAG,CAAM;IAEjB,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CACxB;IAEX,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IAEjD,OAAO,CAAC,2BAA2B,CAAS;IAE5C,OAAO,CAAC,qBAAqB,CAAK;IAElC,OAAO,CAAC,eAAe,CAAS;IAEhC;;OAEG;IACH,MAAM,CAAC,aAAa,IAAI,cAAc;;IAUtC,IAAI,IAAI,IAAI,MAAM,CAGjB;IAED,KAAK,IAAI,IAAI;IAYP,wBAAwB,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AAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,qBAAqB,GACrD,OAAO,CAAC,oBAAoB,CAAC;IAiE1B,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA8B7C,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAY1D,kBAAkB,CACvB,EAAE,oBAAoB,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,gCAAgC,GACzE,OAAO,CAAC,+BAA+B,CAAC;YA4D7B,eAAe;IA+B7B,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,oBAAoB;CAQ5B"} \ No newline at end of file diff --git a/lib/handlers/Firefox60.js b/lib/handlers/Firefox60.js index 40128feb..e804dfdd 100644 --- a/lib/handlers/Firefox60.js +++ b/lib/handlers/Firefox60.js @@ -352,9 +352,17 @@ class Firefox60 extends HandlerInterface_1.HandlerInterface { if (!transceiver) throw new Error('associated RTCRtpTransceiver not found'); const parameters = transceiver.sender.getParameters(); - parameters.encodings.forEach((encoding, idx) => { - parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params); - }); + if (Array.isArray(params)) { + params.reverse(); // reverse encoding order in Firefox + parameters.encodings.forEach((encoding, idx) => { + parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params[idx]); + }); + } + else { + parameters.encodings.forEach((encoding, idx) => { + parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params); + }); + } await transceiver.sender.setParameters(parameters); } async getSenderStats(localId) { diff --git a/lib/handlers/Safari11.d.ts.map b/lib/handlers/Safari11.d.ts.map index 592b4570..ab267735 100644 --- a/lib/handlers/Safari11.d.ts.map +++ b/lib/handlers/Safari11.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Safari11.d.ts","sourceRoot":"","sources":["../../src/handlers/Safari11.ts"],"names":[],"mappings":"AAMA,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAk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CACvB,EAAE,oBAAoB,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,gCAAgC,GACzE,OAAO,CAAC,+BAA+B,CAAC;YA4D7B,eAAe;IA+B7B,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,oBAAoB;CAQ5B"} \ No newline at end of file diff --git a/lib/handlers/Safari11.js b/lib/handlers/Safari11.js index af1b634b..4ebccc6d 100644 --- a/lib/handlers/Safari11.js +++ b/lib/handlers/Safari11.js @@ -326,9 +326,16 @@ class Safari11 extends HandlerInterface_1.HandlerInterface { if (!rtpSender) throw new Error('associated RTCRtpSender not found'); const parameters = rtpSender.getParameters(); - parameters.encodings.forEach((encoding, idx) => { - parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params); - }); + if (Array.isArray(params)) { + parameters.encodings.forEach((encoding, idx) => { + parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params[idx]); + }); + } + else { + parameters.encodings.forEach((encoding, idx) => { + parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params); + }); + } await rtpSender.setParameters(parameters); } async getSenderStats(localId) { diff --git a/lib/handlers/Safari12.d.ts.map b/lib/handlers/Safari12.d.ts.map index 689bb552..76050c4f 100644 --- a/lib/handlers/Safari12.d.ts.map +++ b/lib/handlers/Safari12.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Safari12.d.ts","sourceRoot":"","sources":["../../src/handlers/Safari12.ts"],"names":[],"mappings":"AAMA,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAY,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,eAAe,EAAiB,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAwB,MAAM,mBAA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AAG,OAAO,CAAC,IAAI,CAAC;IAgC3C,YAAY,CACjB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAC7C,OAAO,CAAC,IAAI,CAAC;IAsBV,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BxE,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAiCrE,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAYxD,eAAe,CACpB,EACC,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,QAAQ,EACR,EAAE,6BAA6B,GAC9B,OAAO,CAAC,4BAA4B,CAAC;IAgElC,OAAO,CACZ,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,qBAAqB,GACrD,OAAO,CAAC,oBAAoB,CAAC;IAiE1B,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA8B7C,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAY1D,kBAAkB,CACvB,EAAE,oBAAoB,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,gCAAgC,GACzE,OAAO,CAAC,+BAA+B,CAAC;YA4D7B,eAAe;IA+B7B,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,oBAAoB;CAQ5B"} \ No newline at end of file diff --git a/lib/handlers/Safari12.js b/lib/handlers/Safari12.js index d9f57757..958b4200 100644 --- a/lib/handlers/Safari12.js +++ b/lib/handlers/Safari12.js @@ -298,9 +298,16 @@ class Safari12 extends HandlerInterface_1.HandlerInterface { if (!transceiver) throw new Error('associated RTCRtpTransceiver not found'); const parameters = transceiver.sender.getParameters(); - parameters.encodings.forEach((encoding, idx) => { - parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params); - }); + if (Array.isArray(params)) { + parameters.encodings.forEach((encoding, idx) => { + parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params[idx]); + }); + } + else { + parameters.encodings.forEach((encoding, idx) => { + parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params); + }); + } await transceiver.sender.setParameters(parameters); } async getSenderStats(localId) { diff --git a/src/Producer.ts b/src/Producer.ts index 5b3fc53b..1b3bece1 100644 --- a/src/Producer.ts +++ b/src/Producer.ts @@ -422,7 +422,7 @@ export class Producer extends EnhancedEventEmitter * Sets the DSCP value. */ async setRtpEncodingParameters( - params: RTCRtpEncodingParameters + params: RTCRtpEncodingParameters | RTCRtpEncodingParameters[] ): Promise { if (this._closed) diff --git a/src/handlers/Chrome67.ts b/src/handlers/Chrome67.ts index 0fd80e55..7d227ed1 100644 --- a/src/handlers/Chrome67.ts +++ b/src/handlers/Chrome67.ts @@ -541,10 +541,20 @@ export class Chrome67 extends HandlerInterface const parameters = rtpSender.getParameters(); - parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + if (Array.isArray(params)) { - parameters.encodings[idx] = { ...encoding, ...params }; - }); + parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + { + parameters.encodings[idx] = { ...encoding, ...params[idx] }; + }); + } + else + { + parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + { + parameters.encodings[idx] = { ...encoding, ...params }; + }); + } await rtpSender.setParameters(parameters); } diff --git a/src/handlers/Chrome70.ts b/src/handlers/Chrome70.ts index 0b1ffdff..41f694ef 100644 --- a/src/handlers/Chrome70.ts +++ b/src/handlers/Chrome70.ts @@ -545,10 +545,20 @@ export class Chrome70 extends HandlerInterface const parameters = transceiver.sender.getParameters(); - parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + if (Array.isArray(params)) { - parameters.encodings[idx] = { ...encoding, ...params }; - }); + parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + { + parameters.encodings[idx] = { ...encoding, ...params[idx] }; + }); + } + else + { + parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + { + parameters.encodings[idx] = { ...encoding, ...params }; + }); + } await transceiver.sender.setParameters(parameters); } diff --git a/src/handlers/Chrome74.ts b/src/handlers/Chrome74.ts index 3ad52574..2833f8d1 100644 --- a/src/handlers/Chrome74.ts +++ b/src/handlers/Chrome74.ts @@ -532,10 +532,20 @@ export class Chrome74 extends HandlerInterface const parameters = transceiver.sender.getParameters(); - parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + if (Array.isArray(params)) { - parameters.encodings[idx] = { ...encoding, ...params }; - }); + parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + { + parameters.encodings[idx] = { ...encoding, ...params[idx] }; + }); + } + else + { + parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + { + parameters.encodings[idx] = { ...encoding, ...params }; + }); + } await transceiver.sender.setParameters(parameters); } diff --git a/src/handlers/Edge11.ts b/src/handlers/Edge11.ts index 2f7ec4ee..59677c39 100644 --- a/src/handlers/Edge11.ts +++ b/src/handlers/Edge11.ts @@ -334,10 +334,20 @@ export class Edge11 extends HandlerInterface const parameters = rtpSender.getParameters(); - parameters.encodings.forEach((encoding: any, idx: number) => + if (Array.isArray(params)) { - parameters.encodings[idx] = { ...encoding, ...params }; - }); + parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + { + parameters.encodings[idx] = { ...encoding, ...params[idx] }; + }); + } + else + { + parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + { + parameters.encodings[idx] = { ...encoding, ...params }; + }); + } await rtpSender.setParameters(parameters); } diff --git a/src/handlers/Firefox60.ts b/src/handlers/Firefox60.ts index 36b7c758..18c9d838 100644 --- a/src/handlers/Firefox60.ts +++ b/src/handlers/Firefox60.ts @@ -548,10 +548,21 @@ export class Firefox60 extends HandlerInterface const parameters = transceiver.sender.getParameters(); - parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + if (Array.isArray(params)) { - parameters.encodings[idx] = { ...encoding, ...params }; - }); + params.reverse(); // reverse encoding order in Firefox + parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + { + parameters.encodings[idx] = { ...encoding, ...params[idx] }; + }); + } + else + { + parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + { + parameters.encodings[idx] = { ...encoding, ...params }; + }); + } await transceiver.sender.setParameters(parameters); } diff --git a/src/handlers/Safari11.ts b/src/handlers/Safari11.ts index a467918c..a83a6830 100644 --- a/src/handlers/Safari11.ts +++ b/src/handlers/Safari11.ts @@ -536,10 +536,20 @@ export class Safari11 extends HandlerInterface const parameters = rtpSender.getParameters(); - parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + if (Array.isArray(params)) { - parameters.encodings[idx] = { ...encoding, ...params }; - }); + parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + { + parameters.encodings[idx] = { ...encoding, ...params[idx] }; + }); + } + else + { + parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + { + parameters.encodings[idx] = { ...encoding, ...params }; + }); + } await rtpSender.setParameters(parameters); } diff --git a/src/handlers/Safari12.ts b/src/handlers/Safari12.ts index 38c309a5..389fa371 100644 --- a/src/handlers/Safari12.ts +++ b/src/handlers/Safari12.ts @@ -486,10 +486,20 @@ export class Safari12 extends HandlerInterface const parameters = transceiver.sender.getParameters(); - parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + if (Array.isArray(params)) { - parameters.encodings[idx] = { ...encoding, ...params }; - }); + parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + { + parameters.encodings[idx] = { ...encoding, ...params[idx] }; + }); + } + else + { + parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => + { + parameters.encodings[idx] = { ...encoding, ...params }; + }); + } await transceiver.sender.setParameters(parameters); } diff --git a/test/test.js b/test/test.js index 5c558055..1763f9b0 100644 --- a/test/test.js +++ b/test/test.js @@ -1235,6 +1235,15 @@ test('producer.setRtpEncodingParameters() succeeds', async () => expect(videoProducer.maxSpatialLayer).toBe(0); }, 500); +test('producer.setRtpEncodingParameters() with array succeeds', async () => +{ + await expect(videoProducer.setRtpEncodingParameters([ { foo: 'bar1' }, { foo: 'bar2' } ])) + .resolves + .toBe(undefined); + + expect(videoProducer.maxSpatialLayer).toBe(0); +}, 500); + test('producer.getStats() succeeds', async () => { await expect(videoProducer.getStats()) From 8bef6e79e5bca00743b1f947ffd2ec3d12286fc0 Mon Sep 17 00:00:00 2001 From: t-mullen Date: Wed, 14 Jul 2021 12:14:22 -0400 Subject: [PATCH 2/2] fix: clone params array before reversing --- lib/handlers/Firefox60.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/handlers/Firefox60.js b/lib/handlers/Firefox60.js index e804dfdd..711ca29e 100644 --- a/lib/handlers/Firefox60.js +++ b/lib/handlers/Firefox60.js @@ -353,6 +353,7 @@ class Firefox60 extends HandlerInterface_1.HandlerInterface { throw new Error('associated RTCRtpTransceiver not found'); const parameters = transceiver.sender.getParameters(); if (Array.isArray(params)) { + params = utils.clone(params, []) params.reverse(); // reverse encoding order in Firefox parameters.encodings.forEach((encoding, idx) => { parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params[idx]);