question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setRtpEncodingParameters() documentation/implementation/typings issue

See original GitHub issue

There is currently a problem with producer.setRtpEncodingParameters() method:

  1. Both actual implementation in browser handlers and documentation expect RTCRtpEncodingParameters as an argument
  2. Producer’s API has TypeScript type defined as RTCRtpEncodingParameters[] instead (I guess it only compiles because there is a type information erasing in handlers with params: any)

https://github.com/versatica/mediasoup-client/blob/3aa7f7c3eca4ef39f5e8b3cdb448dbe5008cc71c/src/Producer.ts#L396-L398 https://github.com/versatica/mediasoup-client/blob/3aa7f7c3eca4ef39f5e8b3cdb448dbe5008cc71c/src/handlers/Chrome74.ts#L520-L541

So in TypeScript project it is possible to either specify something that is RTCRtpEncodingParameters[] and will not work or you have to cast it to any to be able to use RTCRtpEncodingParameters directly.

The more annoying thing is that RTCRtpEncodingParameters alone, which is the de-facto current implementation, doesn’t allow applying different values to different encodings (simulcast).

I’d suggest is to add support for RTCRtpEncodingParameters[] such that it is possible to have different parameters for different encodings, but until next major version bump also support old plain RTCRtpEncodingParameters argument for those who rely on it.

If that sounds good, I can prepare a PR.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ibccommented, Jul 6, 2020

This method should just be removed, you can already get get the RtpSender. No need for sugar APIs. But it’s too late to remove it.

BTW you can not change the number of encodings in runtime.

1reaction
ibccommented, Jul 8, 2020

Fixed in 3.6.12.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found