Merge branch 'livekit' into firefox-audio-output

This commit is contained in:
Robin
2024-12-13 14:55:27 -05:00
191 changed files with 4613 additions and 2033 deletions

View File

@@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details.
*/
import {
FC,
type FC,
createContext,
useCallback,
useContext,
@@ -25,7 +25,7 @@ import {
audioInput as audioInputSetting,
audioOutput as audioOutputSetting,
videoInput as videoInputSetting,
Setting,
type Setting,
} from "../settings/settings";
export type DeviceLabel =
@@ -143,13 +143,13 @@ function useMediaDevice(
);
}
const deviceStub: MediaDevice = {
export const deviceStub: MediaDevice = {
available: new Map(),
selectedId: undefined,
selectedGroupId: undefined,
select: () => {},
};
const devicesStub: MediaDevices = {
export const devicesStub: MediaDevices = {
audioInput: deviceStub,
audioOutput: deviceStub,
videoInput: deviceStub,
@@ -157,7 +157,7 @@ const devicesStub: MediaDevices = {
stopUsingDeviceNames: () => {},
};
const MediaDevicesContext = createContext<MediaDevices>(devicesStub);
export const MediaDevicesContext = createContext<MediaDevices>(devicesStub);
interface Props {
children: JSX.Element;

View File

@@ -5,11 +5,11 @@ SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
*/
import { IOpenIDToken, MatrixClient } from "matrix-js-sdk/src/matrix";
import { type IOpenIDToken, type MatrixClient } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession";
import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession";
import { useEffect, useState } from "react";
import { LivekitFocus } from "matrix-js-sdk/src/matrixrtc/LivekitFocus";
import { type LivekitFocus } from "matrix-js-sdk/src/matrixrtc/LivekitFocus";
import { useActiveLivekitFocus } from "../room/useActiveFocus";

View File

@@ -8,10 +8,10 @@ Please see LICENSE in the repository root for full details.
import {
AudioPresets,
DefaultReconnectPolicy,
RoomOptions,
type RoomOptions,
ScreenSharePresets,
TrackPublishDefaults,
VideoPreset,
type TrackPublishDefaults,
type VideoPreset,
VideoPresets,
} from "livekit-client";

View File

@@ -6,10 +6,10 @@ Please see LICENSE in the repository root for full details.
*/
import {
AudioCaptureOptions,
type AudioCaptureOptions,
ConnectionState,
LocalTrack,
Room,
type LocalTrack,
type Room,
RoomEvent,
Track,
} from "livekit-client";
@@ -17,7 +17,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
import { logger } from "matrix-js-sdk/src/logger";
import * as Sentry from "@sentry/react";
import { SFUConfig, sfuConfigEquals } from "./openIDSFU";
import { type SFUConfig, sfuConfigEquals } from "./openIDSFU";
import { PosthogAnalytics } from "../analytics/PosthogAnalytics";
declare global {

View File

@@ -7,32 +7,32 @@ Please see LICENSE in the repository root for full details.
import {
ConnectionState,
E2EEOptions,
type E2EEManagerOptions,
ExternalE2EEKeyProvider,
Room,
RoomOptions,
type RoomOptions,
Track,
} from "livekit-client";
import { useEffect, useMemo, useRef } from "react";
import E2EEWorker from "livekit-client/e2ee-worker?worker";
import { logger } from "matrix-js-sdk/src/logger";
import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession";
import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession";
import { defaultLiveKitOptions } from "./options";
import { SFUConfig } from "./openIDSFU";
import { MuteStates } from "../room/MuteStates";
import { type SFUConfig } from "./openIDSFU";
import { type MuteStates } from "../room/MuteStates";
import {
MediaDevice,
MediaDevices,
type MediaDevice,
type MediaDevices,
useMediaDevices,
} from "./MediaDevicesContext";
import {
ECConnectionState,
type ECConnectionState,
useECConnectionState,
} from "./useECConnectionState";
import { MatrixKeyProvider } from "../e2ee/matrixKeyProvider";
import { E2eeType } from "../e2ee/e2eeType";
import { EncryptionSystem } from "../e2ee/sharedKeyManagement";
import { type EncryptionSystem } from "../e2ee/sharedKeyManagement";
interface UseLivekitResult {
livekitRoom?: Room;
@@ -45,7 +45,7 @@ export function useLiveKit(
sfuConfig: SFUConfig | undefined,
e2eeSystem: EncryptionSystem,
): UseLivekitResult {
const e2eeOptions = useMemo((): E2EEOptions | undefined => {
const e2eeOptions = useMemo((): E2EEManagerOptions | undefined => {
if (e2eeSystem.kind === E2eeType.NONE) return undefined;
if (e2eeSystem.kind === E2eeType.PER_PARTICIPANT) {