-
Notifications
You must be signed in to change notification settings - Fork 788
Open
Description
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?
danjenkins, ROBERT-MCDOWELL, maynor96, JoshuaGeiger, kstarzyk and 3 more
Metadata
Metadata
Assignees
Labels
No labels