webrtc: fix firefox codec detection

This commit is contained in:
Koushik Dutta
2023-01-18 08:06:39 -08:00
parent 0e0ca55605
commit 1297ed9bdf
3 changed files with 9 additions and 7 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/webrtc",
"version": "0.1.24",
"version": "0.1.25",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/webrtc",
"version": "0.1.24",
"version": "0.1.25",
"dependencies": {
"@scrypted/common": "file:../../common",
"@scrypted/sdk": "file:../../sdk",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/webrtc",
"version": "0.1.24",
"version": "0.1.25",
"scripts": {
"scrypted-setup-project": "scrypted-setup-project",
"prescrypted-setup-project": "scrypted-package-json",

View File

@@ -320,16 +320,18 @@ export function parseOptions(options: RTCSignalingOptions) {
}
return false;
});
// firefox is misleading. special case that to disable transcoding.
if (options?.userAgent?.includes('Firefox/'))
sessionSupportsH264High = true;
const transcodeWidth = Math.max(640, Math.min(options?.screen?.width || 960, 1280));
const width = options?.screen?.width;
const height = options?.screen?.height;
const max = Math.max(width, height) * options?.screen?.devicePixelRatio;
const isMediumResolution = !sessionSupportsH264High || (max && max < 1920);
// firefox is misleading. special case that to disable transcoding.
if (options?.userAgent?.includes('Firefox/'))
sessionSupportsH264High = true;
return {
sessionSupportsH264High,
transcodeWidth,