From b2f5c08934f7b170a540ed1b430d998ee4e3bde6 Mon Sep 17 00:00:00 2001 From: morethanwords Date: Sun, 12 Dec 2021 03:25:53 +0400 Subject: [PATCH] Fix gc sound --- .env | 4 ++-- src/lib/appManagers/appGroupCallsManager.ts | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 8c9536e2..679feeb6 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ API_ID=1025907 API_HASH=452b0359b988148995f22ff0f4229750 VERSION=1.0.0 -VERSION_FULL=1.0.0 (38) -BUILD=38 +VERSION_FULL=1.0.0 (40) +BUILD=40 diff --git a/src/lib/appManagers/appGroupCallsManager.ts b/src/lib/appManagers/appGroupCallsManager.ts index 037d6ae5..be5a3ab3 100644 --- a/src/lib/appManagers/appGroupCallsManager.ts +++ b/src/lib/appManagers/appGroupCallsManager.ts @@ -308,6 +308,9 @@ export class GroupCallInstance { // possible Safari fix const audio = new Audio(); audio.play().catch(noop); + audio.autoplay = true; + audio.volume = 1.0; + this.player.append(audio); this.elements.set('audio', audio); } @@ -638,9 +641,15 @@ export class GroupCallInstance { // audio.play(); elements.set(elementEndpoint, element); - }/* else { - element.srcObject = useStream; - } */ + } else { + if(element.paused) { + element.play().catch(noop); + } + + if(element.srcObject !== useStream) { + element.srcObject = useStream; + } + } if(isOutput) { const entry = description.getEntryBySource(+source);