Skip to main content

Connection & Setup

connection

Contains update information about your connection status to the Eyeson API.

{
type: 'connection',
connectionStatus: 'fetch_room' | 'connected' | 'access_denied'
}

room_setup

Received once the real time channel connection is established. This event contains information about the state of the current room.

{
type: 'room_setup',
content: {
access_key: 'token-for-room',
ready: true | false,
room: {
id,
name,
ready: true | false,
shutdown: true | false,
sip: { /* omitted */ } // sip connection credentials
guest_token: 'token-for-guest'
},
team: {
name
},
user: {
id,
name,
avatar,
guest: true | false,
ready: true | false,
sip: { /* omitted */ } // sip connection credentials
},
links: {
self: 'https://api.eyeson.team/rooms/token-for-room',
gui: 'https://app.eyeson.team/?token-for-room',
guest_join: 'https://app.eyeson.team/?guest=token-for-guest',
websocket: 'https://api.eyeson.team/rt?access_key=token-for-room'
},
presentation: { /* ... */ },
broadcasts: [],
recording: null
}
}
note

An Eyeson room server and user may not be available on the first request, therefore there are three status flags included in the response above. Room ready and user ready status, as well as the top level ready flag combining those two.

room_ready

When you establish a real time connection but the Eyeson room isn't ready at that point (i.e. room_setup content ready is false) you'll receive this separate message once the room is ready.

{
type: 'room_ready',
content: {
ready: true,
user: { /* ... */ },
room: { /* ... */ }
}
}

fetch_room

Fetch the room details, provides the room and user information and is also initially received when a room changes its status to ready. The event can be send to the Eyeson room and will return with same type when a response is received.

eyeson.send({ type: 'fetch_room' });
{
type: 'fetch_room',
room: { /* ... */ }
}

accept

Received once a session for the room has been established.

{
type: 'accept',
remoteStream: MediaStream, // the remote stream you're receiving
localStream: MediaStream // your local stream
}

stream_update

Remote or local stream has been updated and needs to be replaced.

{
type: 'stream_update',
stream: MediaStream, // new remote stream
localStream: MediaStream // new local stream
}

disconnect

User has disconnected. If providing a presentation feature you should ensure to close any active presentation held by this user, and on demand remember to restore on reconnect.

{
type: 'disconnect'
}

reconnect

A user has reconnected, received after disconnect.

{
type: 'reconnect'
}

podium

A user has muted the camera, left the room or started a screen capture session. Every connected source, video source indexes and an optional presenter source index are provided.

{
type: 'podium',
solo: true | false, // client is the only participant
audio: true | false, // client participates with audio (is "hearable")
video: true | false, // client participates with video (is "visible")
media: true | false, // source list includes media (e.g. gifs or video files)
sources: sources, // list of source ids
layers: [{ id: String, zIndex: -1|1 }], // list of current layers, empty if no layers exist
isSource: true | false, // client is a source
presenter: clientId, // clientId of presenter
isPresenter: true | false, // client is presenter
hasPresenter: true | false, // a participant is presenting
videoSources: videoSources, // list of video sources
userDimensions: {x, y, w, h}, // viewbox of current user on the remote stream
hasVideoSources: true | false, // session has video sources
hasDesktopSources: true | false, // session has desktop sources
hasMutedVideoPeers: true | false // forwarded video (sfu) is muted
}