From b725627e336f17e3be5dac72c53f8c5e28c91b0e Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Mon, 7 Sep 2020 19:07:14 +0200 Subject: [PATCH] Fixed the dummy voice connection --- shared/js/connection/DummyVoiceConnection.ts | 21 ++++++++++++++++++-- shared/js/ipc/BrowserIPC.ts | 1 + web/app/index.ts | 1 - 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/shared/js/connection/DummyVoiceConnection.ts b/shared/js/connection/DummyVoiceConnection.ts index af151e20..5c19b63e 100644 --- a/shared/js/connection/DummyVoiceConnection.ts +++ b/shared/js/connection/DummyVoiceConnection.ts @@ -5,14 +5,17 @@ import { import {RecorderProfile} from "tc-shared/voice/RecorderProfile"; import {AbstractServerConnection} from "tc-shared/connection/ConnectionBase"; import {VoiceClient} from "tc-shared/voice/VoiceClient"; -import {VoicePlayerLatencySettings, VoicePlayerState} from "tc-shared/voice/VoicePlayer"; -import {WhisperSession} from "tc-shared/voice/VoiceWhisper"; +import {VoicePlayerEvents, VoicePlayerLatencySettings, VoicePlayerState} from "tc-shared/voice/VoicePlayer"; +import {WhisperSession, WhisperTarget} from "tc-shared/voice/VoiceWhisper"; +import {Registry} from "tc-shared/events"; class DummyVoiceClient implements VoiceClient { + readonly events: Registry; private readonly clientId: number; private volume: number; constructor(clientId: number) { + this.events = new Registry(); this.clientId = clientId; this.volume = 1; } @@ -41,6 +44,10 @@ class DummyVoiceClient implements VoiceClient { flushBuffer() { } abortReplay() { } + + + resetLatencySettings() { + } } export class DummyVoiceConnection extends AbstractVoiceConnection { @@ -120,4 +127,14 @@ export class DummyVoiceConnection extends AbstractVoiceConnection { } setWhisperSessionInitializer(initializer: WhisperSessionInitializer | undefined) { } + + getWhisperTarget(): WhisperTarget | undefined { + return undefined; + } + + startWhisper(target: WhisperTarget): Promise { + return Promise.reject(tr("not supported")); + } + + stopWhisper() { } } \ No newline at end of file diff --git a/shared/js/ipc/BrowserIPC.ts b/shared/js/ipc/BrowserIPC.ts index 4c3efc91..8f1c3dbb 100644 --- a/shared/js/ipc/BrowserIPC.ts +++ b/shared/js/ipc/BrowserIPC.ts @@ -1,3 +1,4 @@ +import "broadcastchannel-polyfill"; import * as log from "tc-shared/log"; import {LogCategory} from "tc-shared/log"; import {ConnectHandler} from "tc-shared/ipc/ConnectHandler"; diff --git a/web/app/index.ts b/web/app/index.ts index c2a076b5..417ceb78 100644 --- a/web/app/index.ts +++ b/web/app/index.ts @@ -1,5 +1,4 @@ import "webrtc-adapter"; -import "broadcastchannel-polyfill"; import "./index.scss"; import "./FileTransfer";