From cf6d4a5d9de70f9c12c39600ecdae221da8a1870 Mon Sep 17 00:00:00 2001 From: Mustafa BOLEKEN Date: Wed, 18 Dec 2024 02:18:08 +0300 Subject: [PATCH] Enable AntMedia unit tests --- ...{AntMedia.test.js.bak => AntMedia.test.js} | 1 - react/src/pages/AntMedia.js | 140 ++++++++++++++++++ 2 files changed, 140 insertions(+), 1 deletion(-) rename react/src/__tests__/pages/{AntMedia.test.js.bak => AntMedia.test.js} (99%) diff --git a/react/src/__tests__/pages/AntMedia.test.js.bak b/react/src/__tests__/pages/AntMedia.test.js similarity index 99% rename from react/src/__tests__/pages/AntMedia.test.js.bak rename to react/src/__tests__/pages/AntMedia.test.js index 98d9dbd2..7b5be243 100644 --- a/react/src/__tests__/pages/AntMedia.test.js.bak +++ b/react/src/__tests__/pages/AntMedia.test.js @@ -1752,7 +1752,6 @@ describe('AntMedia Component', () => { jest.useFakeTimers(); currentConference.fakeReconnect(); expect(webRTCAdaptorConstructor.iceConnectionState()).toBe("disconnected"); - expect(webRTCAdaptorScreenConstructor.iceConnectionState()).toBe("disconnected"); jest.runAllTimers(); }); diff --git a/react/src/pages/AntMedia.js b/react/src/pages/AntMedia.js index f4d0e938..98574ddb 100644 --- a/react/src/pages/AntMedia.js +++ b/react/src/pages/AntMedia.js @@ -25,6 +25,7 @@ import PublisherRequestListDrawer from "../Components/PublisherRequestListDrawer import {WebinarRoles} from "../WebinarRoles"; import Stack from "@mui/material/Stack"; +export const ConferenceContext = React.createContext(null); const globals = { //this settings is to keep consistent with the sdk until backend for the app is setup @@ -3009,6 +3010,10 @@ function AntMedia(props) { } window.makeFullScreen = makeFullScreen; + function setMicAudioLevel(audioLevel) { + webRTCAdaptor?.setVolumeLevel(audioLevel); + } + const handleMuteParticipant = React.useCallback((participant) => { setParticipantIdMuted(participant); }, []); @@ -3055,6 +3060,140 @@ function AntMedia(props) { justifyContent="center" alignItems={"center"} > + {props.children} )} + );