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

Add Firefox120 handler #295

Merged
merged 3 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/Device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Chrome74 } from './handlers/Chrome74';
import { Chrome70 } from './handlers/Chrome70';
import { Chrome67 } from './handlers/Chrome67';
import { Chrome55 } from './handlers/Chrome55';
import { Firefox120 } from './handlers/Firefox120';
import { Firefox60 } from './handlers/Firefox60';
import { Safari12 } from './handlers/Safari12';
import { Safari11 } from './handlers/Safari11';
Expand All @@ -29,6 +30,7 @@ export type BuiltinHandlerName =
| 'Chrome70'
| 'Chrome67'
| 'Chrome55'
| 'Firefox120'
| 'Firefox60'
| 'Safari12'
| 'Safari11'
Expand Down Expand Up @@ -140,7 +142,9 @@ export function detectDevice(): BuiltinHandlerName | undefined {
return 'Chrome55';
}
// Firefox.
else if (isFirefox && !isIOS && browserVersion >= 60) {
else if (isFirefox && !isIOS && browserVersion >= 120) {
return 'Firefox120';
} else if (isFirefox && !isIOS && browserVersion >= 60) {
return 'Firefox60';
}
// Firefox on iOS (so Safari).
Expand Down Expand Up @@ -308,6 +312,11 @@ export class Device {
break;
}

case 'Firefox120': {
this._handlerFactory = Firefox120.createFactory();
break;
}

case 'Firefox60': {
this._handlerFactory = Firefox60.createFactory();
break;
Expand Down
12 changes: 3 additions & 9 deletions src/handlers/Chrome111.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,11 @@ export class Chrome111 extends HandlerInterface {
logger.debug('send() [kind:%s, track.id:%s]', track.kind, track.id);

if (encodings && encodings.length > 1) {
encodings.forEach((encoding, idx: number) => {
encoding.rid = `r${idx}`;
});

// Set rid and verify scalabilityMode in each encoding.
// NOTE: Even if WebRTC allows different scalabilityMode (different number
// of temporal layers) per simulcast stream, we need that those are the
// same in all them, so let's pick up the highest value.
// NOTE: If scalabilityMode is not given, Chrome will use L1T3.

let nextRid = 1;
let maxTemporalLayers = 1;

for (const encoding of encodings) {
Expand All @@ -351,10 +345,10 @@ export class Chrome111 extends HandlerInterface {
}
}

for (const encoding of encodings) {
encoding.rid = `r${nextRid++}`;
encodings.forEach((encoding, idx: number) => {
encoding.rid = `r${idx}`;
encoding.scalabilityMode = `L1T${maxTemporalLayers}`;
}
});
}

const sendingRtpParameters: RtpParameters = utils.clone<RtpParameters>(
Expand Down