mirror of
https://github.com/vector-im/element-call.git
synced 2026-10-16 23:45:50 +00:00
Temporarily stop using matrix-js-sdk's LivekitTransport
This will allow matrix-js-sdk to introduce the new variants without livekit_service_url, which we can then adopt in a separate step.
This commit is contained in:
@@ -86,6 +86,17 @@
|
|||||||
],
|
],
|
||||||
"message": "Please use matrix-js-sdk instead"
|
"message": "Please use matrix-js-sdk instead"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"paths": [
|
||||||
|
{
|
||||||
|
"name": "matrix-js-sdk/lib/matrixrtc",
|
||||||
|
"importNames": [
|
||||||
|
"LivekitTransport",
|
||||||
|
"isLivekitTransport",
|
||||||
|
"isLivekitTransportConfig"
|
||||||
|
],
|
||||||
|
"message": "Please use src/LivekitTransport.ts instead"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2023 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||||
|
Please see LICENSE in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { test, expect } from "vitest";
|
||||||
|
import { isLivekitTransport } from "./LivekitTransport";
|
||||||
|
|
||||||
|
test("isLivekitTransport", () => {
|
||||||
|
expect(
|
||||||
|
isLivekitTransport({
|
||||||
|
type: "livekit",
|
||||||
|
livekit_service_url: "http://test.com",
|
||||||
|
}),
|
||||||
|
).toBeTruthy();
|
||||||
|
expect(isLivekitTransport({ type: "livekit" })).toBeFalsy();
|
||||||
|
expect(
|
||||||
|
isLivekitTransport({
|
||||||
|
type: "not-livekit",
|
||||||
|
livekit_service_url: "http://test.com",
|
||||||
|
}),
|
||||||
|
).toBeFalsy();
|
||||||
|
expect(
|
||||||
|
isLivekitTransport({ type: "livekit", other_service_url: "multi_sfu" }),
|
||||||
|
).toBeFalsy();
|
||||||
|
});
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2026 Element Creations Ltd.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||||
|
Please see LICENSE in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { type Transport } from "matrix-js-sdk/lib/matrixrtc";
|
||||||
|
|
||||||
|
// TODO: Delete this module and return to using LivekitTransport from
|
||||||
|
// matrix-js-sdk. This should only exist for a short time to facilitate merging
|
||||||
|
// some breaking changes to LivekitTransport in matrix-js-sdk.
|
||||||
|
|
||||||
|
export interface LivekitTransport extends Transport {
|
||||||
|
type: "livekit";
|
||||||
|
livekit_service_url: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const isLivekitTransport = (object: any): object is LivekitTransport =>
|
||||||
|
object.type === "livekit" && "livekit_service_url" in object;
|
||||||
@@ -16,10 +16,7 @@ import {
|
|||||||
} from "vitest";
|
} from "vitest";
|
||||||
import { act } from "react";
|
import { act } from "react";
|
||||||
import { type RoomMember } from "matrix-js-sdk";
|
import { type RoomMember } from "matrix-js-sdk";
|
||||||
import {
|
import { type CallMembership } from "matrix-js-sdk/lib/matrixrtc";
|
||||||
type LivekitTransport,
|
|
||||||
type CallMembership,
|
|
||||||
} from "matrix-js-sdk/lib/matrixrtc";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
exampleTransport,
|
exampleTransport,
|
||||||
@@ -40,6 +37,7 @@ import {
|
|||||||
} from "../utils/test-fixtures";
|
} from "../utils/test-fixtures";
|
||||||
import { MAX_PARTICIPANT_COUNT_FOR_SOUND } from "../state/CallViewModel/CallViewModel";
|
import { MAX_PARTICIPANT_COUNT_FOR_SOUND } from "../state/CallViewModel/CallViewModel";
|
||||||
import { initializeWidget } from "../widget";
|
import { initializeWidget } from "../widget";
|
||||||
|
import { type LivekitTransport } from "../LivekitTransport";
|
||||||
initializeWidget();
|
initializeWidget();
|
||||||
vitest.mock("livekit-client/e2ee-worker?worker");
|
vitest.mock("livekit-client/e2ee-worker?worker");
|
||||||
vitest.mock("../useAudioContext");
|
vitest.mock("../useAudioContext");
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import {
|
|||||||
type CallMembership,
|
type CallMembership,
|
||||||
type IRTCNotificationContent,
|
type IRTCNotificationContent,
|
||||||
MatrixRTCSessionEvent,
|
MatrixRTCSessionEvent,
|
||||||
type LivekitTransport,
|
|
||||||
} from "matrix-js-sdk/lib/matrixrtc";
|
} from "matrix-js-sdk/lib/matrixrtc";
|
||||||
import { deepCompare } from "matrix-js-sdk/lib/utils";
|
import { deepCompare } from "matrix-js-sdk/lib/utils";
|
||||||
|
|
||||||
@@ -70,6 +69,7 @@ import { MatrixRTCMode } from "../../config/ConfigOptions.ts";
|
|||||||
import { initializeWidget } from "../../widget.ts";
|
import { initializeWidget } from "../../widget.ts";
|
||||||
import { computeUrlParams } from "../../UrlParams.ts";
|
import { computeUrlParams } from "../../UrlParams.ts";
|
||||||
import { callViewModelOptionsFromParams } from "./CallViewModel.ts";
|
import { callViewModelOptionsFromParams } from "./CallViewModel.ts";
|
||||||
|
import { type LivekitTransport } from "../../LivekitTransport.ts";
|
||||||
|
|
||||||
initializeWidget();
|
initializeWidget();
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ import {
|
|||||||
import { type Logger, logger as rootLogger } from "matrix-js-sdk/lib/logger";
|
import { type Logger, logger as rootLogger } from "matrix-js-sdk/lib/logger";
|
||||||
import {
|
import {
|
||||||
MembershipManagerEvent,
|
MembershipManagerEvent,
|
||||||
type LivekitTransport,
|
|
||||||
type MatrixRTCSession,
|
type MatrixRTCSession,
|
||||||
type RTCCallIntent,
|
type RTCCallIntent,
|
||||||
type RTCNotificationType,
|
type RTCNotificationType,
|
||||||
@@ -163,6 +162,7 @@ import {
|
|||||||
type RingingMediaViewModel,
|
type RingingMediaViewModel,
|
||||||
} from "../media/RingingMediaViewModel.ts";
|
} from "../media/RingingMediaViewModel.ts";
|
||||||
import { type GridTileViewModel } from "../TileViewModel.ts";
|
import { type GridTileViewModel } from "../TileViewModel.ts";
|
||||||
|
import { type LivekitTransport } from "../../LivekitTransport.ts";
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
// Larger rename
|
// Larger rename
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ Please see LICENSE in the repository root for full details.
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
Status as RTCMemberStatus,
|
Status as RTCMemberStatus,
|
||||||
type LivekitTransport,
|
|
||||||
type MatrixRTCSession,
|
type MatrixRTCSession,
|
||||||
} from "matrix-js-sdk/lib/matrixrtc";
|
} from "matrix-js-sdk/lib/matrixrtc";
|
||||||
import {
|
import {
|
||||||
@@ -60,6 +59,7 @@ import { initializeWidget } from "../../../widget";
|
|||||||
import { nullHostBridge } from "../../../HostBridge";
|
import { nullHostBridge } from "../../../HostBridge";
|
||||||
import { type LocalTransport } from "./LocalTransport";
|
import { type LocalTransport } from "./LocalTransport";
|
||||||
import * as openIDSFU from "../../../livekit/openIDSFU";
|
import * as openIDSFU from "../../../livekit/openIDSFU";
|
||||||
|
import { type LivekitTransport } from "../../../LivekitTransport";
|
||||||
|
|
||||||
initializeWidget();
|
initializeWidget();
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import { observeParticipantEvents } from "@livekit/components-core";
|
|||||||
import { type MatrixClient } from "matrix-js-sdk";
|
import { type MatrixClient } from "matrix-js-sdk";
|
||||||
import {
|
import {
|
||||||
Status as RTCSessionStatus,
|
Status as RTCSessionStatus,
|
||||||
type LivekitTransport,
|
|
||||||
type MatrixRTCSession,
|
type MatrixRTCSession,
|
||||||
type RTCCallIntent,
|
type RTCCallIntent,
|
||||||
type RTCNotificationType,
|
type RTCNotificationType,
|
||||||
@@ -81,6 +80,7 @@ import {
|
|||||||
import { type HomeserverConnected } from "./HomeserverConnected.ts";
|
import { type HomeserverConnected } from "./HomeserverConnected.ts";
|
||||||
import { type LocalTransport } from "./LocalTransport.ts";
|
import { type LocalTransport } from "./LocalTransport.ts";
|
||||||
import { getSFUConfigWithOpenID } from "../../../livekit/openIDSFU.ts";
|
import { getSFUConfigWithOpenID } from "../../../livekit/openIDSFU.ts";
|
||||||
|
import { type LivekitTransport } from "../../../LivekitTransport.ts";
|
||||||
|
|
||||||
export enum TransportState {
|
export enum TransportState {
|
||||||
/** Not even a transport is available to the LocalMembership */
|
/** Not even a transport is available to the LocalMembership */
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ SPDX-License-IdFentifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|||||||
Please see LICENSE in the repository root for full details.
|
Please see LICENSE in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { type LivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
|
|
||||||
import { type MatrixClient } from "matrix-js-sdk";
|
import { type MatrixClient } from "matrix-js-sdk";
|
||||||
import { logger as rootLogger, type Logger } from "matrix-js-sdk/lib/logger";
|
import { logger as rootLogger, type Logger } from "matrix-js-sdk/lib/logger";
|
||||||
import { type CallMembershipIdentityParts } from "matrix-js-sdk/lib/matrixrtc/EncryptionManager";
|
import { type CallMembershipIdentityParts } from "matrix-js-sdk/lib/matrixrtc/EncryptionManager";
|
||||||
@@ -24,6 +23,7 @@ import {
|
|||||||
import { customLivekitUrl } from "../../../settings/settings.ts";
|
import { customLivekitUrl } from "../../../settings/settings.ts";
|
||||||
import { RtcTransportAutoDiscovery } from "./RtcTransportAutoDiscovery.ts";
|
import { RtcTransportAutoDiscovery } from "./RtcTransportAutoDiscovery.ts";
|
||||||
import { type MatrixRTCMode } from "../../../config/ConfigOptions.ts";
|
import { type MatrixRTCMode } from "../../../config/ConfigOptions.ts";
|
||||||
|
import { type LivekitTransport } from "../../../LivekitTransport.ts";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
ownMembershipIdentity: CallMembershipIdentityParts;
|
ownMembershipIdentity: CallMembershipIdentityParts;
|
||||||
|
|||||||
@@ -15,16 +15,14 @@ import {
|
|||||||
} from "vitest";
|
} from "vitest";
|
||||||
import { MatrixError } from "matrix-js-sdk";
|
import { MatrixError } from "matrix-js-sdk";
|
||||||
import { logger as rootLogger } from "matrix-js-sdk/lib/logger";
|
import { logger as rootLogger } from "matrix-js-sdk/lib/logger";
|
||||||
import {
|
import { type Transport } from "matrix-js-sdk/lib/matrixrtc";
|
||||||
type LivekitTransport,
|
|
||||||
type Transport,
|
|
||||||
} from "matrix-js-sdk/lib/matrixrtc";
|
|
||||||
|
|
||||||
import type { ResolvedConfigOptions } from "../../../config/ConfigOptions.ts";
|
import type { ResolvedConfigOptions } from "../../../config/ConfigOptions.ts";
|
||||||
import {
|
import {
|
||||||
RtcTransportAutoDiscovery,
|
RtcTransportAutoDiscovery,
|
||||||
type RtcTransportAutoDiscoveryProps,
|
type RtcTransportAutoDiscoveryProps,
|
||||||
} from "./RtcTransportAutoDiscovery.ts";
|
} from "./RtcTransportAutoDiscovery.ts";
|
||||||
|
import { type LivekitTransport } from "../../../LivekitTransport.ts";
|
||||||
|
|
||||||
type DiscoveryClient = RtcTransportAutoDiscoveryProps["client"];
|
type DiscoveryClient = RtcTransportAutoDiscoveryProps["client"];
|
||||||
|
|
||||||
|
|||||||
@@ -4,15 +4,15 @@ Copyright 2026 Element Creations Ltd.
|
|||||||
SPDX-License-IdFentifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
SPDX-License-IdFentifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||||
Please see LICENSE in the repository root for full details.
|
Please see LICENSE in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
import {
|
|
||||||
isLivekitTransport,
|
|
||||||
type LivekitTransport,
|
|
||||||
} from "matrix-js-sdk/lib/matrixrtc";
|
|
||||||
import { type MatrixClient } from "matrix-js-sdk";
|
import { type MatrixClient } from "matrix-js-sdk";
|
||||||
import { type Logger } from "matrix-js-sdk/lib/logger";
|
import { type Logger } from "matrix-js-sdk/lib/logger";
|
||||||
|
|
||||||
import type { ResolvedConfigOptions } from "../../../config/ConfigOptions.ts";
|
import type { ResolvedConfigOptions } from "../../../config/ConfigOptions.ts";
|
||||||
import { doNetworkOperationWithRetry } from "../../../utils/matrix.ts";
|
import { doNetworkOperationWithRetry } from "../../../utils/matrix.ts";
|
||||||
|
import {
|
||||||
|
isLivekitTransport,
|
||||||
|
type LivekitTransport,
|
||||||
|
} from "../../../LivekitTransport.ts";
|
||||||
|
|
||||||
type TransportDiscoveryClient = Pick<
|
type TransportDiscoveryClient = Pick<
|
||||||
MatrixClient,
|
MatrixClient,
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import fetchMock from "fetch-mock";
|
|||||||
import EventEmitter from "events";
|
import EventEmitter from "events";
|
||||||
import { type IOpenIDToken } from "matrix-js-sdk";
|
import { type IOpenIDToken } from "matrix-js-sdk";
|
||||||
import { logger, type Logger } from "matrix-js-sdk/lib/logger";
|
import { logger, type Logger } from "matrix-js-sdk/lib/logger";
|
||||||
import { type LivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Connection,
|
Connection,
|
||||||
@@ -45,6 +44,7 @@ import {
|
|||||||
} from "../../../utils/errors.ts";
|
} from "../../../utils/errors.ts";
|
||||||
import { testJWTToken } from "../../../utils/test-fixtures.ts";
|
import { testJWTToken } from "../../../utils/test-fixtures.ts";
|
||||||
import { mockRemoteParticipant, ownMemberMock } from "../../../utils/test.ts";
|
import { mockRemoteParticipant, ownMemberMock } from "../../../utils/test.ts";
|
||||||
|
import { type LivekitTransport } from "../../../LivekitTransport.ts";
|
||||||
|
|
||||||
let testScope: ObservableScope;
|
let testScope: ObservableScope;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import {
|
|||||||
type Track,
|
type Track,
|
||||||
type TrackPublication,
|
type TrackPublication,
|
||||||
} from "livekit-client";
|
} from "livekit-client";
|
||||||
import { type LivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
|
|
||||||
import { BehaviorSubject, map } from "rxjs";
|
import { BehaviorSubject, map } from "rxjs";
|
||||||
import { type Logger } from "matrix-js-sdk/lib/logger";
|
import { type Logger } from "matrix-js-sdk/lib/logger";
|
||||||
import { type CallMembershipIdentityParts } from "matrix-js-sdk/lib/matrixrtc/EncryptionManager";
|
import { type CallMembershipIdentityParts } from "matrix-js-sdk/lib/matrixrtc/EncryptionManager";
|
||||||
@@ -42,6 +41,7 @@ import {
|
|||||||
SFURoomCreationRestrictedError,
|
SFURoomCreationRestrictedError,
|
||||||
UnknownCallError,
|
UnknownCallError,
|
||||||
} from "../../../utils/errors.ts";
|
} from "../../../utils/errors.ts";
|
||||||
|
import { type LivekitTransport } from "../../../LivekitTransport.ts";
|
||||||
|
|
||||||
export interface ConnectionOpts {
|
export interface ConnectionOpts {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import { logger, type Logger } from "matrix-js-sdk/lib/logger";
|
|||||||
// imported as inline to support worker when loaded from a cdn (cross domain)
|
// imported as inline to support worker when loaded from a cdn (cross domain)
|
||||||
import E2EEWorker from "livekit-client/e2ee-worker?worker&inline";
|
import E2EEWorker from "livekit-client/e2ee-worker?worker&inline";
|
||||||
import { type CallMembershipIdentityParts } from "matrix-js-sdk/lib/matrixrtc/EncryptionManager";
|
import { type CallMembershipIdentityParts } from "matrix-js-sdk/lib/matrixrtc/EncryptionManager";
|
||||||
import { type LivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
|
|
||||||
|
|
||||||
import { type ObservableScope } from "../../ObservableScope.ts";
|
import { type ObservableScope } from "../../ObservableScope.ts";
|
||||||
import { Connection } from "./Connection.ts";
|
import { Connection } from "./Connection.ts";
|
||||||
@@ -39,6 +38,7 @@ import {
|
|||||||
noiseSuppressionSetting,
|
noiseSuppressionSetting,
|
||||||
autoGainControlSetting,
|
autoGainControlSetting,
|
||||||
} from "../../../settings/settings.ts";
|
} from "../../../settings/settings.ts";
|
||||||
|
import { type LivekitTransport } from "../../../LivekitTransport.ts";
|
||||||
|
|
||||||
// TODO evaluate if this should be done like the Publisher Factory
|
// TODO evaluate if this should be done like the Publisher Factory
|
||||||
export interface ConnectionFactory {
|
export interface ConnectionFactory {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ Please see LICENSE in the repository root for full details.
|
|||||||
|
|
||||||
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
||||||
import { BehaviorSubject, NEVER } from "rxjs";
|
import { BehaviorSubject, NEVER } from "rxjs";
|
||||||
import { type LivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
|
|
||||||
import { type RemoteParticipant } from "livekit-client";
|
import { type RemoteParticipant } from "livekit-client";
|
||||||
import { logger } from "matrix-js-sdk/lib/logger";
|
import { logger } from "matrix-js-sdk/lib/logger";
|
||||||
|
|
||||||
@@ -21,6 +20,7 @@ import { type Connection } from "./Connection.ts";
|
|||||||
import { ownMemberMock, withTestScheduler } from "../../../utils/test.ts";
|
import { ownMemberMock, withTestScheduler } from "../../../utils/test.ts";
|
||||||
import { areLivekitTransportsEqual } from "./MatrixLivekitMembers.ts";
|
import { areLivekitTransportsEqual } from "./MatrixLivekitMembers.ts";
|
||||||
import { type Behavior } from "../../Behavior.ts";
|
import { type Behavior } from "../../Behavior.ts";
|
||||||
|
import { type LivekitTransport } from "../../../LivekitTransport.ts";
|
||||||
|
|
||||||
// Some test constants
|
// Some test constants
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|||||||
Please see LICENSE in the repository root for full details.
|
Please see LICENSE in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { type LivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
|
|
||||||
import {
|
import {
|
||||||
combineLatest,
|
combineLatest,
|
||||||
map,
|
map,
|
||||||
@@ -32,6 +31,7 @@ import {
|
|||||||
type LocalTransport,
|
type LocalTransport,
|
||||||
} from "../localMember/LocalTransport.ts";
|
} from "../localMember/LocalTransport.ts";
|
||||||
import { type SFUConfig } from "../../../livekit/openIDSFU.ts";
|
import { type SFUConfig } from "../../../livekit/openIDSFU.ts";
|
||||||
|
import { type LivekitTransport } from "../../../LivekitTransport.ts";
|
||||||
|
|
||||||
export class ConnectionManagerData {
|
export class ConnectionManagerData {
|
||||||
private readonly store: Map<
|
private readonly store: Map<
|
||||||
|
|||||||
@@ -7,10 +7,7 @@ Please see LICENSE in the repository root for full details.
|
|||||||
|
|
||||||
import { describe, test, expect, beforeEach, afterEach, vi } from "vitest";
|
import { describe, test, expect, beforeEach, afterEach, vi } from "vitest";
|
||||||
import { logger } from "matrix-js-sdk/lib/logger";
|
import { logger } from "matrix-js-sdk/lib/logger";
|
||||||
import {
|
import { type CallMembership } from "matrix-js-sdk/lib/matrixrtc";
|
||||||
type CallMembership,
|
|
||||||
type LivekitTransport,
|
|
||||||
} from "matrix-js-sdk/lib/matrixrtc";
|
|
||||||
import { BehaviorSubject, combineLatest, map, type Observable } from "rxjs";
|
import { BehaviorSubject, combineLatest, map, type Observable } from "rxjs";
|
||||||
|
|
||||||
import { type IConnectionManager } from "./ConnectionManager.ts";
|
import { type IConnectionManager } from "./ConnectionManager.ts";
|
||||||
@@ -33,6 +30,7 @@ import {
|
|||||||
import { type Connection } from "./Connection.ts";
|
import { type Connection } from "./Connection.ts";
|
||||||
import { constant } from "../../Behavior.ts";
|
import { constant } from "../../Behavior.ts";
|
||||||
import { localRtcMember } from "../../../utils/test-fixtures.ts";
|
import { localRtcMember } from "../../../utils/test-fixtures.ts";
|
||||||
|
import { type LivekitTransport } from "../../../LivekitTransport.ts";
|
||||||
|
|
||||||
let testScope: ObservableScope;
|
let testScope: ObservableScope;
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,7 @@ Please see LICENSE in the repository root for full details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { type LocalParticipant, type RemoteParticipant } from "livekit-client";
|
import { type LocalParticipant, type RemoteParticipant } from "livekit-client";
|
||||||
import {
|
import { type CallMembership } from "matrix-js-sdk/lib/matrixrtc";
|
||||||
type CallMembership,
|
|
||||||
type LivekitTransport,
|
|
||||||
} from "matrix-js-sdk/lib/matrixrtc";
|
|
||||||
import { combineLatest, filter, map } from "rxjs";
|
import { combineLatest, filter, map } from "rxjs";
|
||||||
import { logger } from "matrix-js-sdk/lib/logger";
|
import { logger } from "matrix-js-sdk/lib/logger";
|
||||||
|
|
||||||
@@ -18,6 +15,7 @@ import { type IConnectionManager } from "./ConnectionManager";
|
|||||||
import { Epoch, type ObservableScope } from "../../ObservableScope";
|
import { Epoch, type ObservableScope } from "../../ObservableScope";
|
||||||
import { type Connection } from "./Connection";
|
import { type Connection } from "./Connection";
|
||||||
import { generateItemsWithEpoch } from "../../../utils/observable";
|
import { generateItemsWithEpoch } from "../../../utils/observable";
|
||||||
|
import { type LivekitTransport } from "../../../LivekitTransport";
|
||||||
|
|
||||||
interface LocalTaggedParticipant {
|
interface LocalTaggedParticipant {
|
||||||
type: "local";
|
type: "local";
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import { BehaviorSubject, NEVER } from "rxjs";
|
|||||||
import { type Room as LivekitRoom } from "livekit-client";
|
import { type Room as LivekitRoom } from "livekit-client";
|
||||||
import EventEmitter from "events";
|
import EventEmitter from "events";
|
||||||
import fetchMock from "fetch-mock";
|
import fetchMock from "fetch-mock";
|
||||||
import { type LivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
|
|
||||||
import { logger } from "matrix-js-sdk/lib/logger";
|
import { logger } from "matrix-js-sdk/lib/logger";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -35,6 +34,7 @@ import {
|
|||||||
import { createConnectionManager$ } from "./ConnectionManager.ts";
|
import { createConnectionManager$ } from "./ConnectionManager.ts";
|
||||||
import { membershipsAndTransports$ } from "../../SessionBehaviors.ts";
|
import { membershipsAndTransports$ } from "../../SessionBehaviors.ts";
|
||||||
import { localRtcMember, testJWTToken } from "../../../utils/test-fixtures.ts";
|
import { localRtcMember, testJWTToken } from "../../../utils/test-fixtures.ts";
|
||||||
|
import { type LivekitTransport } from "../../../LivekitTransport.ts";
|
||||||
|
|
||||||
// Test the integration of ConnectionManager and MatrixLivekitMerger
|
// Test the integration of ConnectionManager and MatrixLivekitMerger
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,8 @@ Please see LICENSE in the repository root for full details.
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
type CallMembership,
|
type CallMembership,
|
||||||
type LivekitTransport,
|
|
||||||
type MatrixRTCSession,
|
type MatrixRTCSession,
|
||||||
MatrixRTCSessionEvent,
|
MatrixRTCSessionEvent,
|
||||||
isLivekitTransport,
|
|
||||||
} from "matrix-js-sdk/lib/matrixrtc";
|
} from "matrix-js-sdk/lib/matrixrtc";
|
||||||
import { fromEvent } from "rxjs";
|
import { fromEvent } from "rxjs";
|
||||||
|
|
||||||
@@ -21,6 +19,7 @@ import {
|
|||||||
type ObservableScope,
|
type ObservableScope,
|
||||||
} from "./ObservableScope";
|
} from "./ObservableScope";
|
||||||
import { type Behavior } from "./Behavior";
|
import { type Behavior } from "./Behavior";
|
||||||
|
import { isLivekitTransport, type LivekitTransport } from "../LivekitTransport";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tracks the transports used by ourselves, plus all other MatrixRTC session
|
* Tracks the transports used by ourselves, plus all other MatrixRTC session
|
||||||
|
|||||||
+1
-3
@@ -25,8 +25,6 @@ import {
|
|||||||
} from "matrix-js-sdk";
|
} from "matrix-js-sdk";
|
||||||
import {
|
import {
|
||||||
CallMembership,
|
CallMembership,
|
||||||
type LivekitFocusSelection,
|
|
||||||
type LivekitTransport,
|
|
||||||
type MatrixRTCSession,
|
type MatrixRTCSession,
|
||||||
MatrixRTCSessionEvent,
|
MatrixRTCSessionEvent,
|
||||||
type MatrixRTCSessionEventHandlerMap,
|
type MatrixRTCSessionEventHandlerMap,
|
||||||
@@ -79,6 +77,7 @@ import {
|
|||||||
} from "../state/media/RemoteScreenShareViewModel";
|
} from "../state/media/RemoteScreenShareViewModel";
|
||||||
import { Connection } from "../state/CallViewModel/remoteMembers/Connection";
|
import { Connection } from "../state/CallViewModel/remoteMembers/Connection";
|
||||||
import { type SFUConfig } from "../livekit/openIDSFU";
|
import { type SFUConfig } from "../livekit/openIDSFU";
|
||||||
|
import { type LivekitTransport } from "../LivekitTransport";
|
||||||
|
|
||||||
export function withFakeTimers(continuation: () => void): void {
|
export function withFakeTimers(continuation: () => void): void {
|
||||||
vi.useFakeTimers();
|
vi.useFakeTimers();
|
||||||
@@ -228,7 +227,6 @@ export function mockRtcMembership(
|
|||||||
rtcBackendIdentity?: string;
|
rtcBackendIdentity?: string;
|
||||||
callId?: string;
|
callId?: string;
|
||||||
fociPreferred?: Transport[];
|
fociPreferred?: Transport[];
|
||||||
focusActive?: LivekitFocusSelection;
|
|
||||||
membership?: Partial<SessionMembershipData>;
|
membership?: Partial<SessionMembershipData>;
|
||||||
},
|
},
|
||||||
): CallMembership {
|
): CallMembership {
|
||||||
|
|||||||
Reference in New Issue
Block a user