matrix-js-sdk
    Preparing search index...

    Class CallMembership

    Index

    Constructors

    • Parameters

      • matrixEvent: Pick<MatrixEvent, "getId" | "getSender" | "getTs">

        The required parts of the Matrix event that this membership is based on

      • membershipData: MembershipData

        The type checked membership data {data: (content of the matrix event), kind: (type hint)}

      • rtcBackendIdentity: string

        Anonymized identity to use with the RTC backend.

        The rtcBackendIdentity is a hashed version of all the identity parts: sha256(${this.userId}|${this.deviceId}|${this.memberId})

        It is used to anonymize the identity of the user in the RTC backend.

      • Optionallogger: Logger

        The constructor will automatically create a properly tagged child logger instance.

      Returns CallMembership

    Properties

    rtcBackendIdentity: string

    Anonymized identity to use with the RTC backend.

    The rtcBackendIdentity is a hashed version of all the identity parts: sha256(${this.userId}|${this.deviceId}|${this.memberId})

    It is used to anonymize the identity of the user in the RTC backend.

    Accessors

    • get memberId(): string

      This computes the membership ID for the membership. For the sticky event based rtcSessionData this is trivial it is member.id. This is not supposed to be used to identity on an rtc backend. This is just a nouance for a generated (sha256) anonymised identity. Only send rtcBackendIdentity to any rtc backend service.

      For the legacy sessionMemberEvents it is a bit more complex. Here we sometimes do not have this data in the event content and we expected the SFU and the client to use ${this.matrixEventData.sender}:${data.device_id}.

      So if there is no membershipID we use the hard coded jwt id default (${this.matrixEventData.sender}:${data.device_id}) value (used until version 0.16.0)

      It is also possible for a session event to set a custom membershipID. in that case this will be used.

      Returns string

    • get slotId(): string

      The ID of the MatrixRTC slot that this membership belongs to (format {application}#{id}). This is computed in case SessionMembershipData is used.

      Returns string

    Methods

    • Gets the absolute expiry timestamp of the membership.

      Returns number | undefined

      The absolute expiry time of the membership as a unix timestamp in milliseconds or undefined if not applicable

    • Returns number | undefined

      The number of milliseconds until the membership expires or undefined if applicable

    • Gets the primary transport to use for this RTC membership (m.rtc.member). This will return the primary transport that is used by this call membership to publish their media. Directly relates to the rtc_transports field.

      In case of a legacy session membership (m.call.member) this will return the selected transport where media is published. How this selection happens depends on the focus_active field of the session membership. If the focus_selection is oldest_membership this will return the transport of the oldest membership in the room (based on the created_ts field of the session membership). If the focus_selection is multi_sfu it will return the first transport of the foci_preferred list. (multi_sfu is equivalent to how m.rtc.member rtc_transports work).

      Parameters

      • oldestMembership: CallMembership

        For backwards compatibility with session membership (legacy). Unused in case of RTC membership. Always required to make the consumer not care if it deals with RTC or session memberships.

      Returns Transport | undefined

      The transport this membership uses to publish media or undefined if no transport is available.