Skip to main content

Events

Overview

These are the Infinity ClientV2 server-sent events that are available to the plugin. As they are simply forwarded, documentation is available here: https://docs.pexip.com/api_client/api_rest.htm#server_sent

How you listen to events

plugin.events.myEvent.add(newMyEvent => {
// read and act on the new event message
});

Available Events

Conference Status

Provides updates on conference status changes

Syntax

plugin.events.conferenceStatus.add(({id, status}) => {})

ConferenceStatus:

{
id: string; // id of the room that this event is for, "main" indicates the main vmr for both breakout and non-breakout cases.
status: {
locked: boolean;
guestsMuted: boolean;
allMuted: boolean;
started: boolean;
liveCaptionsAvailable: boolean;
breakoutRooms: boolean;
directMedia: boolean;
presentationAllowed: boolean;
classification?: {
current: number;
levels: Record<number, string>;
};
breakout: boolean;
breakoutName?: string;
breakoutDescription?: string;
endTime?: number;
endAction?: 'transfer' | 'disconnect';
rawData: ConferenceStatusEvent;
}
}

Connected

Signals that the call has been connected, more precisely, that packets are flowing to and from the remote end.

Syntax

plugin.events.connected.add(() => {})

Disconnected

Signals an unexpected disconnect from the current call & conference.

Syntax

plugin.events.disconnected.add(reason => {})

Reason

{ error: string; errorCode: pexCode; }

List of pexCode: https://docs.pexip.com/clients/error_messages.htm

Me

Signals updates for the self participant

Syntax

plugin.events.me.add(({id, participant}) => {})

Participant

export interface Participant {
callType: CallType;
canControl: boolean;
canChangeLayout: boolean;
canDisconnect: boolean;
canMute: boolean;
canTransfer: boolean;
canFecc: boolean;
canRaiseHand: boolean;
canSpotlight: boolean;
displayName?: string;
overlayText: string;
handRaisedTime: number;
identity: string;
isCameraMuted: boolean;
isConjoined: boolean;
isEndpoint?: boolean;
isExternal: boolean;
isIdpAuthenticated?: boolean;
isGateway: boolean;
isHost: boolean;
isMainVideoDroppedOut: boolean;
isMuted: boolean;
isPresenting: boolean;
isSpotlight: boolean;
isStreaming: boolean;
isVideoSilent: boolean;
isWaiting: boolean;
needsPresentationInMix: boolean;
protocol: '' | 'sip' | 'h323' | 'rtmp' | 'mssip' | 'api' | 'webrtc';
raisedHand: boolean;
role: 'chair' | 'guest';
rxPresentation: boolean;
serviceType:
| 'connecting'
| 'waiting_room'
| 'ivr'
| 'conference'
| 'lecture'
| 'gateway'
| 'test_call'
| undefined;
spotlightOrder: number;
startAt: Date;
startTime: number;
uri: string;
uuid: string;
vendor: string | undefined;
rawData: RTCParticipantEvent;
}
id: string; // id of the room that this event is for, "main" indicates the main vmr for both breakout and non-breakout cases.
participant: Participant;

Participants

Provides the current list of the participants, sent every time a participant state changes.

Syntax

plugin.events.participants.add(({id, participants}) => {})

Participants

As with the other breakout-enabled events, id is the target room that this event is for, "main" indicates the main vmr for both breakout and non-breakout cases.

Array of participant.

Message

Text messages sent to the whole conference

Syntax

plugin.events.message.add(message => {})

Message:

export interface Message {
at: Date;
id: string;
message: string;
displayName: string;
userId: string;
direct: boolean;
}

Direct Message

Text messages sent to the self participant only

Syntax

plugin.events.directMessage.add(message => {})

Message:

See message

Application Message

Object messages which can be directed either to the whole conference or to the self participant only. This is indicated by the direct boolean property.

Syntax

plugin.events.applicationMessage.add(message => {})

ApplicationMessage:

ApplicationMessage { message: Record<string, unknown>; // arbitrary object }

Participant Joined

Signals a new participant has joined.

Syntax

plugin.events.participantJoined.add(({id,participant}) => {})

Participant

participant

Participant Left

Signals a participant has left

Syntax

plugin.events.participantLeft.add(({id,participant}) => {})

Participant

participant

Raise Hand

Signals a participant has raised its hand

Syntax

plugin.events.raiseHand.add(({id,participant}) => {})

Participant

participant

Transfer

Signals the self participant was referred to another conference.

Syntax

plugin.events.transfer.add(transferDetails => {})

TransferDetails:

TransferDetails { alias: string; }

Stage

Signals stage updates.

Syntax

plugin.events.stage.add(stageParticipants => {})

Stage:

Stage { userId: string; stageIndex: number; vad: number; }[]

PresentationConnectionStateChange

Provides updates about the state of the presentation

Syntax

plugin.events.presentationConnectionStateChange.add(state => {})

PresentationConnectionState

PresentationConnectionState { send: RTCPeerConnectionState recv: RTCPeerConnectionState }[]

RTCPeerConnectionState

type RTCPeerConnectionState = "closed" | "connected" | "connecting" | "disconnected" | "failed" | "new"

More information about RTCPeerConnectionState can be found here

LayoutUpdate

Signals layout updates

Syntax

plugin.events.layoutUpdate.add(layoutEvent => {})

LayoutEvent

interface LayoutEvent {
requested_layout: {
primary_screen: {
chair_layout: Layout;
guest_layout: Layout;
};
};
view: Layout;
participants: string[];
}

type Layout =
| '1:0'
| '1:7'
| '1:21'
| '2:21'
| '1:33'
| '4:0'
| '9:0'
| '16:0'
| '25:0'
| '5:7'
| 'ac_presentation_in_mix'
| 'ac_presentation_in_mix_group'
| undefined;

AuthenticatedWithConference

Emitted with successfully obtaining a token (internally via request_token)

plugin.events.authenticatedWithConference.add(conferenceContext => {})

ConferenceContext

{
conferenceAlias: string;
conferenceName?: string;
}

UserInitiatedDisconnect

Emitted when the user clicks the leave button.

plugin.events.userInitiatedDisconnect.add(() => {})

Cancel Transfer

Emitted when a participant transfer has been suspended or is no longer relevant.

plugin.events.cancelTransfer.add(() => {})

BreakoutBegin

Emitted to hosts when a breakout room is successfully opened.

plugin.events.breakoutBegin.add(breakoutRoom => {})

BreakoutRoom

export interface BreakoutRoom {
breakout_uuid: string;
participant_uuid: string;
}

BreakoutEnd

Emitted to hosts when a breakout room is no longer available.

plugin.events.breakoutEnd.add(breakoutRoom => {})

BreakoutRoom

export interface BreakoutRoom {
breakout_uuid: string;
participant_uuid: string;
}

BreakoutRefer

Emitted to hosts telling them to move their media to the breakout specified by the uuid in the event.

Can either be triggered by themselves, or responding to a BreakoutRefer from another host.

export interface BreakoutReferDetails {
breakoutUuid: string;
breakoutName: string;
requesterUuid: string;
}

plugin.events.breakoutRefer.add(referDetails => {})

LanguageSelect

Emitted upon selected language change. The initial value is also signaled if the event is registered at the plugin registration level.

The value is the language tag.

plugin.events.languageSelect.add(lng => {})