From f9ea07e43c3bab8b8a4d54dfc189ac71df9a651c Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 13 Jun 2024 14:11:48 +0100 Subject: [PATCH 1/3] Fix screen sharing in recent Chrome Dreadful hack to work around a bug in recent chrome/electron's WebRTC, as explained. I'm not sure which is the least hideous out of this (ie. repeatedly calling setCodecPreferences and seeing if it crashes each time) or hardcoding the bad codec and skipping it. Opinions welcome. --- src/webrtc/call.ts | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/src/webrtc/call.ts b/src/webrtc/call.ts index 45d35f60c9f..723c0108c68 100644 --- a/src/webrtc/call.ts +++ b/src/webrtc/call.ts @@ -25,7 +25,7 @@ import { v4 as uuidv4 } from "uuid"; import { parse as parseSdp, write as writeSdp } from "sdp-transform"; import { logger } from "../logger"; -import { checkObjectHasKeys, isNullOrUndefined, recursivelyAssign } from "../utils"; +import { checkObjectHasKeys, deepCompare, isNullOrUndefined, recursivelyAssign } from "../utils"; import { MatrixEvent } from "../models/event"; import { EventType, TimelineEvents, ToDeviceMessageId } from "../@types/event"; import { RoomMember } from "../models/room-member"; @@ -2381,22 +2381,42 @@ export class MatrixCall extends TypedEventEmitter => { From 81d7430ca7eeb0133ff3e4a67c0501c4926ecc4f Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 13 Jun 2024 14:17:47 +0100 Subject: [PATCH 2/3] Unused import --- src/webrtc/call.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webrtc/call.ts b/src/webrtc/call.ts index 723c0108c68..27dc578d89b 100644 --- a/src/webrtc/call.ts +++ b/src/webrtc/call.ts @@ -25,7 +25,7 @@ import { v4 as uuidv4 } from "uuid"; import { parse as parseSdp, write as writeSdp } from "sdp-transform"; import { logger } from "../logger"; -import { checkObjectHasKeys, deepCompare, isNullOrUndefined, recursivelyAssign } from "../utils"; +import { checkObjectHasKeys, isNullOrUndefined, recursivelyAssign } from "../utils"; import { MatrixEvent } from "../models/event"; import { EventType, TimelineEvents, ToDeviceMessageId } from "../@types/event"; import { RoomMember } from "../models/room-member"; From f97308cbc4071dbb58ac97f1ed8c49d08c49463e Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 13 Jun 2024 14:20:39 +0100 Subject: [PATCH 3/3] Remove commented line --- src/webrtc/call.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/webrtc/call.ts b/src/webrtc/call.ts index 27dc578d89b..3f5c61a9e23 100644 --- a/src/webrtc/call.ts +++ b/src/webrtc/call.ts @@ -2415,8 +2415,6 @@ export class MatrixCall extends TypedEventEmitter => {