Merge pull request #3745 from element-hq/robin/ringing
Tidy up media view models a little bit
This commit is contained in:
@@ -257,10 +257,9 @@ abstract class BaseMediaViewModel {
|
|||||||
* The Matrix user to which this media belongs.
|
* The Matrix user to which this media belongs.
|
||||||
*/
|
*/
|
||||||
public readonly userId: string,
|
public readonly userId: string,
|
||||||
public readonly rtcBackendIdentity: string,
|
|
||||||
// We don't necessarily have a participant if a user connects via MatrixRTC but not (yet) through
|
// We don't necessarily have a participant if a user connects via MatrixRTC but not (yet) through
|
||||||
// livekit.
|
// livekit.
|
||||||
protected readonly participant$: Observable<
|
protected readonly participant$: Behavior<
|
||||||
LocalParticipant | RemoteParticipant | null
|
LocalParticipant | RemoteParticipant | null
|
||||||
>,
|
>,
|
||||||
|
|
||||||
@@ -407,8 +406,11 @@ abstract class BaseUserMediaViewModel extends BaseMediaViewModel {
|
|||||||
scope: ObservableScope,
|
scope: ObservableScope,
|
||||||
id: string,
|
id: string,
|
||||||
userId: string,
|
userId: string,
|
||||||
rtcBackendIdentity: string,
|
/**
|
||||||
participant$: Observable<LocalParticipant | RemoteParticipant | null>,
|
* The expected identity of the LiveKit participant. Exposed for debugging.
|
||||||
|
*/
|
||||||
|
public readonly rtcBackendIdentity: string,
|
||||||
|
participant$: Behavior<LocalParticipant | RemoteParticipant | null>,
|
||||||
encryptionSystem: EncryptionSystem,
|
encryptionSystem: EncryptionSystem,
|
||||||
livekitRoom$: Behavior<LivekitRoom | undefined>,
|
livekitRoom$: Behavior<LivekitRoom | undefined>,
|
||||||
focusUrl$: Behavior<string | undefined>,
|
focusUrl$: Behavior<string | undefined>,
|
||||||
@@ -421,7 +423,6 @@ abstract class BaseUserMediaViewModel extends BaseMediaViewModel {
|
|||||||
scope,
|
scope,
|
||||||
id,
|
id,
|
||||||
userId,
|
userId,
|
||||||
rtcBackendIdentity,
|
|
||||||
participant$,
|
participant$,
|
||||||
encryptionSystem,
|
encryptionSystem,
|
||||||
Track.Source.Microphone,
|
Track.Source.Microphone,
|
||||||
@@ -677,7 +678,7 @@ export class RemoteUserMediaViewModel extends BaseUserMediaViewModel {
|
|||||||
id: string,
|
id: string,
|
||||||
userId: string,
|
userId: string,
|
||||||
rtcBackendIdentity: string,
|
rtcBackendIdentity: string,
|
||||||
participant$: Observable<RemoteParticipant | null>,
|
participant$: Behavior<RemoteParticipant | null>,
|
||||||
encryptionSystem: EncryptionSystem,
|
encryptionSystem: EncryptionSystem,
|
||||||
livekitRoom$: Behavior<LivekitRoom | undefined>,
|
livekitRoom$: Behavior<LivekitRoom | undefined>,
|
||||||
focusUrl$: Behavior<string | undefined>,
|
focusUrl$: Behavior<string | undefined>,
|
||||||
@@ -779,8 +780,7 @@ export class ScreenShareViewModel extends BaseMediaViewModel {
|
|||||||
scope: ObservableScope,
|
scope: ObservableScope,
|
||||||
id: string,
|
id: string,
|
||||||
userId: string,
|
userId: string,
|
||||||
rtcBackendIdentity: string,
|
participant$: Behavior<LocalParticipant | RemoteParticipant>,
|
||||||
participant$: Observable<LocalParticipant | RemoteParticipant>,
|
|
||||||
encryptionSystem: EncryptionSystem,
|
encryptionSystem: EncryptionSystem,
|
||||||
livekitRoom$: Behavior<LivekitRoom | undefined>,
|
livekitRoom$: Behavior<LivekitRoom | undefined>,
|
||||||
focusUrl$: Behavior<string | undefined>,
|
focusUrl$: Behavior<string | undefined>,
|
||||||
@@ -793,7 +793,6 @@ export class ScreenShareViewModel extends BaseMediaViewModel {
|
|||||||
scope,
|
scope,
|
||||||
id,
|
id,
|
||||||
userId,
|
userId,
|
||||||
rtcBackendIdentity,
|
|
||||||
participant$,
|
participant$,
|
||||||
encryptionSystem,
|
encryptionSystem,
|
||||||
Track.Source.ScreenShareAudio,
|
Track.Source.ScreenShareAudio,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Copyright 2025 New Vector Ltd.
|
|||||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
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 { of } from "rxjs";
|
|
||||||
import {
|
import {
|
||||||
type LocalParticipant,
|
type LocalParticipant,
|
||||||
type RemoteParticipant,
|
type RemoteParticipant,
|
||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
import { type ObservableScope } from "./ObservableScope.ts";
|
import { type ObservableScope } from "./ObservableScope.ts";
|
||||||
import { ScreenShareViewModel } from "./MediaViewModel.ts";
|
import { ScreenShareViewModel } from "./MediaViewModel.ts";
|
||||||
import type { EncryptionSystem } from "../e2ee/sharedKeyManagement.ts";
|
import type { EncryptionSystem } from "../e2ee/sharedKeyManagement.ts";
|
||||||
import type { Behavior } from "./Behavior.ts";
|
import { constant, type Behavior } from "./Behavior.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A screen share media item to be presented in a tile. This is a thin wrapper
|
* A screen share media item to be presented in a tile. This is a thin wrapper
|
||||||
@@ -28,7 +28,6 @@ export class ScreenShare {
|
|||||||
private readonly scope: ObservableScope,
|
private readonly scope: ObservableScope,
|
||||||
id: string,
|
id: string,
|
||||||
userId: string,
|
userId: string,
|
||||||
rtcBackendIdentity: string,
|
|
||||||
participant: LocalParticipant | RemoteParticipant,
|
participant: LocalParticipant | RemoteParticipant,
|
||||||
encryptionSystem: EncryptionSystem,
|
encryptionSystem: EncryptionSystem,
|
||||||
livekitRoom$: Behavior<LivekitRoom | undefined>,
|
livekitRoom$: Behavior<LivekitRoom | undefined>,
|
||||||
@@ -41,8 +40,7 @@ export class ScreenShare {
|
|||||||
this.scope,
|
this.scope,
|
||||||
id,
|
id,
|
||||||
userId,
|
userId,
|
||||||
rtcBackendIdentity,
|
constant(participant),
|
||||||
of(participant),
|
|
||||||
encryptionSystem,
|
encryptionSystem,
|
||||||
livekitRoom$,
|
livekitRoom$,
|
||||||
focusUrl$,
|
focusUrl$,
|
||||||
|
|||||||
@@ -143,7 +143,6 @@ export class UserMedia {
|
|||||||
scope,
|
scope,
|
||||||
`${this.id}:${key}`,
|
`${this.id}:${key}`,
|
||||||
this.userId,
|
this.userId,
|
||||||
this.rtcBackendIdentity,
|
|
||||||
p,
|
p,
|
||||||
this.encryptionSystem,
|
this.encryptionSystem,
|
||||||
this.livekitRoom$,
|
this.livekitRoom$,
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import {
|
|||||||
type SpotlightTileViewModel,
|
type SpotlightTileViewModel,
|
||||||
} from "./TileViewModel.ts";
|
} from "./TileViewModel.ts";
|
||||||
import {
|
import {
|
||||||
|
type LocalUserMediaViewModel,
|
||||||
|
type RemoteUserMediaViewModel,
|
||||||
type MediaViewModel,
|
type MediaViewModel,
|
||||||
type UserMediaViewModel,
|
type UserMediaViewModel,
|
||||||
} from "./MediaViewModel.ts";
|
} from "./MediaViewModel.ts";
|
||||||
@@ -40,8 +42,8 @@ export interface SpotlightExpandedLayoutMedia {
|
|||||||
|
|
||||||
export interface OneOnOneLayoutMedia {
|
export interface OneOnOneLayoutMedia {
|
||||||
type: "one-on-one";
|
type: "one-on-one";
|
||||||
local: UserMediaViewModel;
|
local: LocalUserMediaViewModel;
|
||||||
remote: UserMediaViewModel;
|
remote: RemoteUserMediaViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PipLayoutMedia {
|
export interface PipLayoutMedia {
|
||||||
|
|||||||
Reference in New Issue
Block a user