Skip to main content

Class: Channel

Constructors

constructor

new Channel(target, chanId)

RPC communication based on window postMessage

Parameters

NameTypeDescription
targetWindowessentially a window obj we want to send messages to
chanIdstringChannel id. Allows one frame to contain multiple plugins.

Properties

chanId

Private Readonly chanId: string

Channel id. Allows one frame to contain multiple plugins.


eventListeners

Private eventListeners: Set<ChannelEventListener>


pendingCalls

Private pendingCalls: Map<string, [(_: undefined | void | UnlockParticipantResponse | DisconnectParticipantResponse | DialResponse | TransferParticipantResponse | MuteParticipantResponse | UnmuteParticipantResponse | MuteguestsResponse | UnmuteguestsResponse | VideoMuteParticipantResponse | VideoUnmuteParticipantResponse | LockResponse | UnlockResponse | DisconnectResponse | TransformLayoutResponse | MessageConferenceResponse | MessageParticipantResponse | BuzzParticipantResponse | ClearbuzzParticipantResponse | SpotlightonParticipantResponse | SpotlightoffParticipantResponse | OverlaytextParticipantResponse | DtmfParticipantResponse | DtmfResponse | { data: unknown ; status: number } | ParticipantsResponse | ButtonRPCReply<undefined> | GenericRPCReply<undefined> | { ack: true }) => void, (_: Error) => void]>


target

Private target: Window

essentially a window obj we want to send messages to

Accessors

targetWindow

get targetWindow(): Window

Returns

Window

Methods

addEventListener

addEventListener(listener): void

Parameters

NameType
listenerChannelEventListener

Returns

void


callRPC

callRPC<T>(method, payload, transfer?): Promise<RPCCallReply<T>>

Type parameters

NameType
Textends keyof RPCCalls

Parameters

NameType
methodT
payloadRPCCalls[T][``"payload"``]
transfer?Transferable[]

Returns

Promise<RPCCallReply<T>>


emitEvent

Private emitEvent(event): void

Parameters

NameType
eventOmit<{ chanId: string ; event: "participant:disconnected" ; payload: { participantUuid: string } }, "chanId"> | Omit<{ chanId: string ; event: "ui:button:click" ; payload: { buttonId: string ; input: { buttonId: string } } | { buttonId: string ; input: { participantUuid: string } } }, "chanId"> | Omit<{ chanId: string ; event: "ui:form:input" ; payload: { input: FormInput ; modalId: string } }, "chanId"> | Omit<{ chanId: string ; event: "ui:prompt:input" ; payload: { input: string ; modalId: string } }, "chanId"> | Omit<{ chanId: string ; event: "event:conference:authenticated" ; payload: { conferenceAlias: string } }, "chanId"> | Omit<{ chanId: string ; event: "event:conferenceStatus" ; payload: ConferenceStatus }, "chanId"> | Omit<{ chanId: string ; event: "event:connected" ; payload: undefined }, "chanId"> | Omit<{ chanId: string ; event: "event:disconnected" ; payload: { error: ExtendedInfinityErrorMessage ; errorCode: ExtendedInfinityErrorCode } }, "chanId"> | Omit<{ chanId: string ; event: "event:me" ; payload: InfinityParticipant }, "chanId"> | Omit<{ chanId: string ; event: "event:message" ; payload: Message }, "chanId"> | Omit<{ chanId: string ; event: "event:directMessage" ; payload: Message }, "chanId"> | Omit<{ chanId: string ; event: "event:applicationMessage" ; payload: ApplicationMessage }, "chanId"> | Omit<{ chanId: string ; event: "event:transfer" ; payload: TransferDetails }, "chanId"> | Omit<{ chanId: string ; event: "event:stage" ; payload: Stage[] }, "chanId"> | Omit<{ chanId: string ; event: "event:participants" ; payload: InfinityParticipant[] }, "chanId"> | Omit<{ chanId: string ; event: "event:participantJoined" ; payload: InfinityParticipant }, "chanId"> | Omit<{ chanId: string ; event: "event:participantLeft" ; payload: InfinityParticipant }, "chanId"> | Omit<{ chanId: string ; event: "event:raiseHand" ; payload: InfinityParticipant }, "chanId"> | Omit<{ chanId: string ; event: "event:presentationConnectionStateChange" ; payload: { recv: RTCPeerConnectionState ; send: RTCPeerConnectionState } }, "chanId"> | Omit<{ chanId: string ; event: "event:layoutUpdate" ; payload: LayoutEvent }, "chanId"> | Omit<{ chanId: string ; payload: undefined | DisconnectParticipantResponse ; replyTo: string ; rpc: "participant:disconnect" }, "chanId"> | Omit<{ chanId: string ; payload: { ack: true } ; replyTo: string ; rpc: "syn" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | DialResponse ; replyTo: string ; rpc: "conference:dialOut" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | MessageConferenceResponse | MessageParticipantResponse ; replyTo: string ; rpc: "conference:sendMessage" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | MessageConferenceResponse | MessageParticipantResponse ; replyTo: string ; rpc: "conference:sendApplicationMessage" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | LockResponse | UnlockResponse ; replyTo: string ; rpc: "conference:lock" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | MuteguestsResponse | UnmuteguestsResponse ; replyTo: string ; rpc: "conference:muteAllGuests" }, "chanId"> | Omit<{ chanId: string ; payload: void ; replyTo: string ; rpc: "conference:setBandwidth" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | TransformLayoutResponse ; replyTo: string ; rpc: "conference:setLayout" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | { data: unknown ; status: number } ; replyTo: string ; rpc: "conference:sendRequest" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | DisconnectResponse ; replyTo: string ; rpc: "conference:disconnectAll" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | ParticipantsResponse ; replyTo: string ; rpc: "conference:requestParticipants" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | TransferParticipantResponse ; replyTo: string ; rpc: "participant:transfer" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | MuteParticipantResponse | UnmuteParticipantResponse ; replyTo: string ; rpc: "participant:mute" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | VideoMuteParticipantResponse | VideoUnmuteParticipantResponse ; replyTo: string ; rpc: "participant:muteVideo" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | SpotlightonParticipantResponse | SpotlightoffParticipantResponse ; replyTo: string ; rpc: "participant:spotlight" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | UnlockParticipantResponse ; replyTo: string ; rpc: "participant:admit" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | BuzzParticipantResponse | ClearbuzzParticipantResponse ; replyTo: string ; rpc: "participant:raiseHand" }, "chanId"> | Omit<{ chanId: string ; payload: void ; replyTo: string ; rpc: "participant:setRole" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | OverlaytextParticipantResponse ; replyTo: string ; rpc: "participant:setTextOverlay" }, "chanId"> | Omit<{ chanId: string ; payload: undefined | DtmfParticipantResponse | DtmfResponse ; replyTo: string ; rpc: "participant:sendDTMF" }, "chanId"> | Omit<{ chanId: string ; payload: ButtonRPCReply<undefined> ; replyTo: string ; rpc: "ui:button:add" }, "chanId"> | Omit<{ chanId: string ; payload: ButtonRPCReply<undefined> ; replyTo: string ; rpc: "ui:button:update" }, "chanId"> | Omit<{ chanId: string ; payload: GenericRPCReply<undefined> ; replyTo: string ; rpc: "ui:form:open" }, "chanId"> | Omit<{ chanId: string ; payload: GenericRPCReply<undefined> ; replyTo: string ; rpc: "ui:prompt:open" }, "chanId"> | Omit<{ chanId: string ; payload: GenericRPCReply<undefined> ; replyTo: string ; rpc: "ui:toast:show" }, "chanId"> | Omit<{ chanId: string ; payload: GenericRPCReply<undefined> ; replyTo: string ; rpc: "ui:removeElement" }, "chanId">

Returns

void


onMessage

Private onMessage(evt): void

Parameters

NameType
evtMessageEvent<PluginMessage>

Returns

void


removeEventListener

removeEventListener(listener): void

Parameters

NameType
listenerChannelEventListener

Returns

void


replyRPC

replyRPC<T>(event): void

Type parameters

NameType
Textends keyof RPCCalls

Parameters

NameType
eventChannelRPCReply<T>

Returns

void


sendEvent

sendEvent<T>(event): void

Type parameters

NameType
Textends keyof EventMessage

Parameters

NameType
eventChannelEvent<T>

Returns

void


unregister

unregister(): void

Returns

void