mirror of
https://github.com/vector-im/element-call.git
synced 2026-10-16 23:45:50 +00:00
Show the whole transport in debug UI and logs
A transport may soon carry a LiveKit SFU `url` instead of, or as well as, a `livekit_service_url`, so a service URL alone no longer identifies it. Pass the whole transport to the tiles' debug stats and print it as JSON in log lines instead of picking out the service URL. Element Call's media view models carry the member's raw transport from the SDK's TransportMetadata to the tiles.
This commit is contained in:
@@ -16,12 +16,12 @@ import classNames from "classnames";
|
|||||||
import { Modal } from "./Modal";
|
import { Modal } from "./Modal";
|
||||||
import styles from "./RTCConnectionStats.module.css";
|
import styles from "./RTCConnectionStats.module.css";
|
||||||
import mediaViewStyles from "../src/tile/MediaView.module.css";
|
import mediaViewStyles from "../src/tile/MediaView.module.css";
|
||||||
import { type UnstableLivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
|
import { type Transport } from "matrix-js-sdk/lib/matrixrtc";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
audio?: RTCInboundRtpStreamStats | RTCOutboundRtpStreamStats;
|
audio?: RTCInboundRtpStreamStats | RTCOutboundRtpStreamStats;
|
||||||
video?: RTCInboundRtpStreamStats | RTCOutboundRtpStreamStats;
|
video?: RTCInboundRtpStreamStats | RTCOutboundRtpStreamStats;
|
||||||
transport?: UnstableLivekitTransport;
|
transport?: Transport;
|
||||||
rtcBackendIdentity?: string;
|
rtcBackendIdentity?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -674,8 +674,8 @@ export function createCallViewModel$(
|
|||||||
rtcBackendIdentity: member.rtcBackendIdentity,
|
rtcBackendIdentity: member.rtcBackendIdentity,
|
||||||
member,
|
member,
|
||||||
encryptionSystem: options.encryptionSystem,
|
encryptionSystem: options.encryptionSystem,
|
||||||
focusUrl$: scope.behavior(
|
transport$: scope.behavior(
|
||||||
member.transport$.pipe(map((transport) => transport?.id)),
|
member.transport$.pipe(map((transport) => transport?.raw)),
|
||||||
),
|
),
|
||||||
mediaDevices,
|
mediaDevices,
|
||||||
pretendToBeDisconnected$: reconnecting$,
|
pretendToBeDisconnected$: reconnecting$,
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import {
|
|||||||
trackBySource$,
|
trackBySource$,
|
||||||
type VideoMediaTrack,
|
type VideoMediaTrack,
|
||||||
} from "@element-hq/matrixrtc-sdk";
|
} from "@element-hq/matrixrtc-sdk";
|
||||||
|
import { type Transport } from "matrix-js-sdk/lib/matrixrtc";
|
||||||
import {
|
import {
|
||||||
combineLatest,
|
combineLatest,
|
||||||
distinctUntilChanged,
|
distinctUntilChanged,
|
||||||
@@ -56,10 +57,10 @@ export interface BaseMemberMediaViewModel extends BaseMediaViewModel {
|
|||||||
*/
|
*/
|
||||||
video$: Behavior<VideoMediaTrack | undefined>;
|
video$: Behavior<VideoMediaTrack | undefined>;
|
||||||
/**
|
/**
|
||||||
* The URL of the transport on which this member should be publishing.
|
* The transport on which this member should be publishing, as it appears
|
||||||
* Exposed for debugging.
|
* in the membership. Exposed for debugging.
|
||||||
*/
|
*/
|
||||||
transport$: Behavior<UnstableLivekitTransport | undefined>;
|
transport$: Behavior<Transport | undefined>;
|
||||||
/**
|
/**
|
||||||
* Whether there should be a warning that this media is unencrypted.
|
* Whether there should be a warning that this media is unencrypted.
|
||||||
*/
|
*/
|
||||||
@@ -74,7 +75,7 @@ export interface MemberMediaInputs extends BaseMediaViewModel {
|
|||||||
member: MediaMember;
|
member: MediaMember;
|
||||||
audioSource: "microphone" | "screenShareAudio";
|
audioSource: "microphone" | "screenShareAudio";
|
||||||
videoSource: "camera" | "screenShare";
|
videoSource: "camera" | "screenShare";
|
||||||
focusUrl$: Behavior<string | undefined>;
|
transport$: Behavior<Transport | undefined>;
|
||||||
encryptionSystem: EncryptionSystem;
|
encryptionSystem: EncryptionSystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,11 +43,11 @@ export function createRemoteUserMedia(
|
|||||||
|
|
||||||
const waitingForMedia$ = scope.behavior(
|
const waitingForMedia$ = scope.behavior(
|
||||||
combineLatest(
|
combineLatest(
|
||||||
[inputs.focusUrl$, inputs.member.tracks$],
|
[inputs.transport$, inputs.member.tracks$],
|
||||||
// Without a transport the user is not attempting to publish anywhere
|
// Without a transport the user is not attempting to publish anywhere
|
||||||
// and so we shouldn't expect media. (They might be a subscribe-only bot
|
// and so we shouldn't expect media. (They might be a subscribe-only bot
|
||||||
// for example.)
|
// for example.)
|
||||||
(focusUrl, tracks) => focusUrl !== undefined && tracks === null,
|
(transport, tracks) => transport !== undefined && tracks === null,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
waitingForMedia$.pipe(scope.bind()).subscribe((waiting) => {
|
waitingForMedia$.pipe(scope.bind()).subscribe((waiting) => {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ import { type RemoteUserMediaViewModel } from "../state/media/RemoteUserMediaVie
|
|||||||
import { type UserMediaViewModel } from "../state/media/UserMediaViewModel";
|
import { type UserMediaViewModel } from "../state/media/UserMediaViewModel";
|
||||||
import { type RingingMediaViewModel } from "../state/media/RingingMediaViewModel";
|
import { type RingingMediaViewModel } from "../state/media/RingingMediaViewModel";
|
||||||
import { RingingStatus } from "./RingingStatus";
|
import { RingingStatus } from "./RingingStatus";
|
||||||
import { type UnstableLivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
|
import { type Transport } from "matrix-js-sdk/lib/matrixrtc";
|
||||||
|
|
||||||
interface TileProps {
|
interface TileProps {
|
||||||
ref?: Ref<HTMLDivElement>;
|
ref?: Ref<HTMLDivElement>;
|
||||||
@@ -104,7 +104,7 @@ interface UserMediaTileProps extends TileProps {
|
|||||||
playbackMuted: boolean;
|
playbackMuted: boolean;
|
||||||
waitingForMedia?: boolean;
|
waitingForMedia?: boolean;
|
||||||
primaryButton?: ReactNode;
|
primaryButton?: ReactNode;
|
||||||
transport: UnstableLivekitTransport | undefined;
|
transport: Transport | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import { ReactionIndicator } from "../reactions/ReactionIndicator";
|
|||||||
import { RTCConnectionStats } from "../RTCConnectionStats";
|
import { RTCConnectionStats } from "../RTCConnectionStats";
|
||||||
import videoPlaceholder from "../graphics/video-placeholder.gif";
|
import videoPlaceholder from "../graphics/video-placeholder.gif";
|
||||||
import { autoVideoFit } from "../utils/videoFit";
|
import { autoVideoFit } from "../utils/videoFit";
|
||||||
import { type UnstableLivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
|
import { type Transport } from "matrix-js-sdk/lib/matrixrtc";
|
||||||
|
|
||||||
interface Props extends ComponentProps<typeof animated.div> {
|
interface Props extends ComponentProps<typeof animated.div> {
|
||||||
className?: string;
|
className?: string;
|
||||||
@@ -69,9 +69,9 @@ interface Props extends ComponentProps<typeof animated.div> {
|
|||||||
videoStreamStats?: RTCInboundRtpStreamStats | RTCOutboundRtpStreamStats;
|
videoStreamStats?: RTCInboundRtpStreamStats | RTCOutboundRtpStreamStats;
|
||||||
rtcBackendIdentity?: string;
|
rtcBackendIdentity?: string;
|
||||||
/**
|
/**
|
||||||
* The LiveKit transport, mainly for debugging purposes.
|
* The member's transport, mainly for debugging purposes.
|
||||||
*/
|
*/
|
||||||
transport?: UnstableLivekitTransport;
|
transport?: Transport;
|
||||||
/**
|
/**
|
||||||
* Called whenever the aspect ratio of the video content becomes known or
|
* Called whenever the aspect ratio of the video content becomes known or
|
||||||
* otherwise changes.
|
* otherwise changes.
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ import { platform } from "../Platform";
|
|||||||
import { type RingingMediaViewModel } from "../state/media/RingingMediaViewModel";
|
import { type RingingMediaViewModel } from "../state/media/RingingMediaViewModel";
|
||||||
import { RingingStatus } from "./RingingStatus";
|
import { RingingStatus } from "./RingingStatus";
|
||||||
import { useRootElement } from "../RootElementContext";
|
import { useRootElement } from "../RootElementContext";
|
||||||
import { type UnstableLivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
|
import { type Transport } from "matrix-js-sdk/lib/matrixrtc";
|
||||||
|
|
||||||
interface SpotlightItemBaseProps {
|
interface SpotlightItemBaseProps {
|
||||||
ref?: Ref<HTMLDivElement>;
|
ref?: Ref<HTMLDivElement>;
|
||||||
@@ -75,7 +75,7 @@ interface SpotlightItemBaseProps {
|
|||||||
interface SpotlightMemberMediaItemBaseProps extends SpotlightItemBaseProps {
|
interface SpotlightMemberMediaItemBaseProps extends SpotlightItemBaseProps {
|
||||||
video: VideoMediaTrack | undefined;
|
video: VideoMediaTrack | undefined;
|
||||||
unencryptedWarning: boolean;
|
unencryptedWarning: boolean;
|
||||||
transport: UnstableLivekitTransport | undefined;
|
transport: Transport | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SpotlightUserMediaItemBaseProps extends SpotlightMemberMediaItemBaseProps {
|
interface SpotlightUserMediaItemBaseProps extends SpotlightMemberMediaItemBaseProps {
|
||||||
|
|||||||
+4
-4
@@ -372,7 +372,7 @@ export function mockLocalMedia(
|
|||||||
tracks$: constant(tracks),
|
tracks$: constant(tracks),
|
||||||
}),
|
}),
|
||||||
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
|
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
|
||||||
focusUrl$: constant("https://rtc-example.org"),
|
transport$: constant(exampleTransport),
|
||||||
mediaDevices,
|
mediaDevices,
|
||||||
displayName$: constant(member.rawDisplayName ?? "nodisplayname"),
|
displayName$: constant(member.rawDisplayName ?? "nodisplayname"),
|
||||||
mxcAvatarUrl$: constant(member.getMxcAvatarUrl()),
|
mxcAvatarUrl$: constant(member.getMxcAvatarUrl()),
|
||||||
@@ -386,7 +386,7 @@ export function mockRemoteMedia(
|
|||||||
roomMember: Partial<RoomMember>,
|
roomMember: Partial<RoomMember>,
|
||||||
/** The tracks, or a behavior of them for a test that has them arrive. */
|
/** The tracks, or a behavior of them for a test that has them arrive. */
|
||||||
tracks: MockTracks | Behavior<MockTracks>,
|
tracks: MockTracks | Behavior<MockTracks>,
|
||||||
{ focusUrl }: { focusUrl?: string } = { focusUrl: "https://rtc-example.org" },
|
{ transport }: { transport?: Transport } = { transport: exampleTransport },
|
||||||
): RemoteUserMediaViewModel {
|
): RemoteUserMediaViewModel {
|
||||||
const member = mockMatrixRoomMember(rtcMember, roomMember);
|
const member = mockMatrixRoomMember(rtcMember, roomMember);
|
||||||
return createRemoteUserMedia(testScope(), {
|
return createRemoteUserMedia(testScope(), {
|
||||||
@@ -400,7 +400,7 @@ export function mockRemoteMedia(
|
|||||||
tracks === null || Array.isArray(tracks) ? constant(tracks) : tracks,
|
tracks === null || Array.isArray(tracks) ? constant(tracks) : tracks,
|
||||||
}),
|
}),
|
||||||
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
|
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
|
||||||
focusUrl$: constant(focusUrl),
|
transport$: constant(transport),
|
||||||
pretendToBeDisconnected$: constant(false),
|
pretendToBeDisconnected$: constant(false),
|
||||||
displayName$: constant(member.rawDisplayName ?? "nodisplayname"),
|
displayName$: constant(member.rawDisplayName ?? "nodisplayname"),
|
||||||
mxcAvatarUrl$: constant(member.getMxcAvatarUrl()),
|
mxcAvatarUrl$: constant(member.getMxcAvatarUrl()),
|
||||||
@@ -424,7 +424,7 @@ export function mockRemoteScreenShare(
|
|||||||
tracks$: constant(tracks),
|
tracks$: constant(tracks),
|
||||||
}),
|
}),
|
||||||
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
|
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
|
||||||
focusUrl$: constant("https://rtc-example.org"),
|
transport$: constant(exampleTransport),
|
||||||
pretendToBeDisconnected$: constant(false),
|
pretendToBeDisconnected$: constant(false),
|
||||||
displayName$: constant(member.rawDisplayName ?? "nodisplayname"),
|
displayName$: constant(member.rawDisplayName ?? "nodisplayname"),
|
||||||
mxcAvatarUrl$: constant(member.getMxcAvatarUrl()),
|
mxcAvatarUrl$: constant(member.getMxcAvatarUrl()),
|
||||||
|
|||||||
Reference in New Issue
Block a user