Class GroupCall

Typed Event Emitter class which can act as a Base Model for all our model and communication events. This makes it much easier for us to distinguish between events, as we now need to properly type this, so that our events are not stringly-based and prone to silly typos.

Type parameters:

  • Events - List of all events emitted by this TypedEventEmitter. Normally an enum type.
  • Arguments - A ListenerMap type providing mappings from event names to listener types.
  • SuperclassArguments - TODO: not really sure. Alternative listener mappings, I think? But only honoured for .emit?

Hierarchy (view full)

Constructors

Properties

Accessors

Methods

Constructors

Properties

_creationTs: null | number = null
_enteredViaAnotherSession: boolean = false
_livekitServiceURL?: string
_participants: Map<RoomMember, Map<string, ParticipantState>> = ...
_state: GroupCallState = GroupCallState.LocalCallFeedUninitialized
activeSpeaker?: CallFeed
activeSpeakerInterval: number = 1000
activeSpeakerLoopInterval?: number
allowCallWithoutVideoAndAudio: boolean
callHandlers: Map<string, Map<string, ICallHandlers>> = ...
calls: Map<string, Map<string, MatrixCall>> = ...
client: MatrixClient
dataChannelOptions?: IGroupCallDataChannelOptions
dataChannelsEnabled?: boolean
groupCallId: string
initCallFeedPromise?: Promise<void>
initWithAudioMuted: boolean = false
initWithVideoMuted: boolean = false
isPtt: boolean
localCallFeed?: CallFeed
localDesktopCapturerSourceId?: string
localScreenshareFeed?: CallFeed
participantTimeout: number = ...
participantsExpirationTimer: null | number = null
pttMaxTransmitTime: number = ...
reEmitter: ReEmitter
resendMemberStateTimer: null | number = null
retryCallCounts: Map<string, Map<string, number>> = ...
retryCallInterval: number = 5000
retryCallLoopInterval?: number
room: Room
screenshareFeeds: CallFeed[] = []
stats: undefined | GroupCallStats
statsCollectIntervalTime: number = 0

Configure default webrtc stats collection interval in ms Disable collecting webrtc stats by setting interval to 0

transmitTimer: null | number = null
useLivekit: boolean = false
userMediaFeeds: CallFeed[] = []

Accessors

  • get creationTs(): null | number
  • The timestamp at which the call was created, or null if it has not yet been created.

    Returns null | number

  • set creationTs(value): void
  • Parameters

    • value: null | number

    Returns void

  • get enteredViaAnotherSession(): boolean
  • Whether the local device has entered this call via another session, such as a widget.

    Returns boolean

  • set enteredViaAnotherSession(value): void
  • Parameters

    • value: boolean

    Returns void

Methods

  • Determines whether the given call is one that we were expecting to exist given our knowledge of who is participating in the group call.

    Parameters

    Returns boolean

  • If we allow entering a call without a camera and without video, it can happen that the access rights to the devices have not yet been queried. If a stream does not yet have an audio track, we assume that the rights have not yet been checked.

    this.client.getMediaHandler().getUserMediaStream clones the current stream, so it only wanted to be called when not Audio Track exists. As such, this is a compromise, because, the access rights should always be queried before the call.

    Parameters

    • muted: boolean

    Returns Promise<boolean>

  • Cleans up our member state by filtering out logged out devices, inactive devices, and our own device (if we know we haven't entered).

    Returns Promise<void>

  • Executes the given callback on all calls in this group call.

    Parameters

    • f: ((call) => void)

      The callback.

        • (call): void
        • Parameters

          Returns void

    Returns void

  • Places calls to all participants that we're responsible for calling.

    Returns void

  • Sets the mute state of the local participants's video.

    Parameters

    • muted: boolean

      Whether to mute the video

    Returns Promise<boolean>

    Whether muting/unmuting was successful

  • Sets the mute state of the local participants's microphone.

    Parameters

    • muted: boolean

      Whether to mute the microphone

    Returns Promise<boolean>

    Whether muting/unmuting was successful

  • Recalculates and updates the participant map to match the room state.

    Returns void

  • Determines whether a given participant expects us to call them (versus them calling us).

    Parameters

    • userId: string

      The participant's user ID.

    • deviceId: string

      The participant's device ID.

    Returns boolean

    Whether we need to place an outgoing call to the participant.

Generated using TypeDoc