mirror of
https://github.com/koush/scrypted.git
synced 2026-09-18 01:30:39 +01:00
webrtc: fix firefox codec detection
This commit is contained in:
4
plugins/webrtc/package-lock.json
generated
4
plugins/webrtc/package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user