mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
detect calls using a foci
This commit is contained in:
parent
90ba35da7a
commit
43dea3bfdc
@ -22,11 +22,17 @@ export enum EventType {
|
|||||||
// TODO: Change to "sdp_stream_metadata" when MSC3077 is merged
|
// TODO: Change to "sdp_stream_metadata" when MSC3077 is merged
|
||||||
export const SDPStreamMetadataKey = "org.matrix.msc3077.sdp_stream_metadata";
|
export const SDPStreamMetadataKey = "org.matrix.msc3077.sdp_stream_metadata";
|
||||||
|
|
||||||
|
export interface FocusConfig {
|
||||||
|
user_id: string,
|
||||||
|
device_id: string
|
||||||
|
}
|
||||||
|
|
||||||
export interface CallDeviceMembership {
|
export interface CallDeviceMembership {
|
||||||
device_id: string,
|
device_id: string,
|
||||||
session_id: string,
|
session_id: string,
|
||||||
["expires_ts"]?: number,
|
["expires_ts"]?: number,
|
||||||
feeds?: Array<{purpose: string}>
|
feeds?: Array<{purpose: string}>
|
||||||
|
["m.foci.active"]?: Array<FocusConfig>
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CallMembership {
|
export interface CallMembership {
|
||||||
|
@ -145,6 +145,15 @@ export class GroupCall extends EventEmitter<{change: never}> {
|
|||||||
return !!this.callContent?.["m.terminated"];
|
return !!this.callContent?.["m.terminated"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get usesFoci(): boolean {
|
||||||
|
for (const member of this._members.values()) {
|
||||||
|
if (member.usesFoci) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
get duration(): number | undefined {
|
get duration(): number | undefined {
|
||||||
if (typeof this.startTime === "number") {
|
if (typeof this.startTime === "number") {
|
||||||
return (this.options.clock.now() - this.startTime);
|
return (this.options.clock.now() - this.startTime);
|
||||||
|
@ -117,6 +117,11 @@ export class Member {
|
|||||||
return this.errorBoundary.error;
|
return this.errorBoundary.error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get usesFoci(): boolean {
|
||||||
|
const activeFoci = this.callDeviceMembership["m.foci.active"];
|
||||||
|
return Array.isArray(activeFoci) && activeFoci.length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
private _renewExpireTimeout(log: ILogItem) {
|
private _renewExpireTimeout(log: ILogItem) {
|
||||||
this.expireTimeout?.dispose();
|
this.expireTimeout?.dispose();
|
||||||
this.expireTimeout = undefined;
|
this.expireTimeout = undefined;
|
||||||
|
Loading…
Reference in New Issue
Block a user