Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting priority on RTC session sender's encodings #873

Open
marcovidonis opened this issue Oct 3, 2024 · 1 comment
Open

Setting priority on RTC session sender's encodings #873

marcovidonis opened this issue Oct 3, 2024 · 1 comment

Comments

@marcovidonis
Copy link

I'm looking at adding the option to set the sender's priority when adding local media stream tracks to the peer connection in RTCSession. In some applications, this could be used as a QoS marker, to make sure the user agent allocates a higher bandwidth, for example.

The way I would do it this:

this._localMediaStream = stream;
if (stream)
{
  stream.getTracks().forEach((track) =>
  {
    let sender = this._connection.addTrack(track, stream);
    const params = sender.getParameters();
      params.encodings = params.encodings.map((e) => {
        if (!this.priority) return e;
        if (e.priority) {
          e.priority = this.priority;
        }
        if (e.networkPriority) {
          e.networkPriority = this.priority;
        }
        return e;
      });
      sender.setParameters(params);
  });
}

Would this addition be of interested to the project? If so, I'd be happy to open a PR for it.

Also, I'm not too sure where the best place would be to define this.priority: in RTCSession.js itself, perhaps? Or better pass it to the constructor?

@kstarzyk
Copy link

I've verified This works in Chrome ( 130.0.6723.117) but does not work in Safari (17.x) - both desktop and mobile (rdcp is set to 0 - can be checked in wireshark capture).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants