From 446aa6cbe3d6b1494546dccf2d4b38dc3d2ae8aa Mon Sep 17 00:00:00 2001 From: Lukas Hass Date: Tue, 1 Feb 2022 00:34:48 +0100 Subject: [PATCH] fix simple-peer import --- front/src/WebRtc/ScreenSharingPeer.ts | 3 ++- front/src/WebRtc/VideoPeer.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/front/src/WebRtc/ScreenSharingPeer.ts b/front/src/WebRtc/ScreenSharingPeer.ts index 3f953709..a6a20cb4 100644 --- a/front/src/WebRtc/ScreenSharingPeer.ts +++ b/front/src/WebRtc/ScreenSharingPeer.ts @@ -6,8 +6,9 @@ import { Readable, readable, writable, Writable } from "svelte/store"; import { getIceServersConfig } from "../Components/Video/utils"; import { highlightedEmbedScreen } from "../Stores/EmbedScreensStore"; import { isMediaBreakpointUp } from "../Utils/BreakpointsUtils"; +import Peer from "simple-peer"; -const Peer: SimplePeerNamespace.SimplePeer = require("simple-peer"); +// const { default: Peer } = await import("simple-peer"); /** * A peer connection used to transmit video / audio signals between 2 peers. diff --git a/front/src/WebRtc/VideoPeer.ts b/front/src/WebRtc/VideoPeer.ts index c3b6d45e..9214670c 100644 --- a/front/src/WebRtc/VideoPeer.ts +++ b/front/src/WebRtc/VideoPeer.ts @@ -10,8 +10,9 @@ import { playersStore } from "../Stores/PlayersStore"; import { chatMessagesStore, newChatMessageSubject } from "../Stores/ChatStore"; import { getIceServersConfig } from "../Components/Video/utils"; import { isMediaBreakpointUp } from "../Utils/BreakpointsUtils"; +import Peer from "simple-peer"; -const Peer: SimplePeerNamespace.SimplePeer = require("simple-peer"); +// const { default: Peer } = await import("simple-peer"); export type PeerStatus = "connecting" | "connected" | "error" | "closed";