Room
Televisit Room
Configuring Room Triggers
There are three special trigger events for the room object: room.after
, participant.after
and track.after
. Each occurs in response to a web hook call from the video provider. These events are also recorded in the room's events[]
list.
Note recording.after
and composition.after
will be implemented in future versions.
To handle events triggered by the remote room provider, insert these Cortex script triggers.
Room Events
All room events share the following properties:
type
{ String } Indexed room event type [room
,participant
,track
]name
{ String } Indexed room event name.created
,ended
,connected
, etc.order
{ Number } Indexed integer representing the order in which the remote event was fired. It's possible thatevents are called and written out of order. The
order
property may be used to present the remote timeline.roomId
{ ObjectID } Indexed originating local room identifier.
room.after :: room.created
- Room is open and available for connection.
room.after :: room.created
- Room is open and available for connection.room.after :: room.ended
- Room is closed, or ended due to a timeout (empty for 5 minutes).
room.after :: room.ended
- Room is closed, or ended due to a timeout (empty for 5 minutes).duration
{ Number } The number of seconds the room was active.
participant.after :: participant.connected
- Participant entered a room
participant.after :: participant.connected
- Participant entered a roomstatus
{ String } The current status of the participant generating this event - eitherconnected
ordisconnected
.accountId
{ ObjectID } The id of the account generating the event.
participant.after :: participant.disconnected
- Participant left a room
participant.after :: participant.disconnected
- Participant left a roomstatus
{ String } The current status of the participant generating this event - eitherconnected
ordisconnected
.accountId
{ ObjectID } The id of the account generating the event.duration
{ Number } The number of seconds the participant was connected to the room.
track.after :: track.added
- Participant added a track
track.after :: track.added
- Participant added a trackstatus
{ String } The current status of the participant generating this event - eitherconnected
ordisconnected
.accountId
{ ObjectID } The id of the account generating the event.trackKind
{ String } The kind of track -data
,audio
orvideo
.trackName
{ String } The track name. Currently unused and set to a uuid.
track.after :: track.removed
- Participant removed a track
track.after :: track.removed
- Participant removed a trackstatus
{ String } The current status of the participant generating this event - eitherconnected
ordisconnected
.accountId
{ ObjectID } The id of the account generating the event.trackKind
{ String } The kind of track -data
,audio
orvideo
.trackName
{ String } The track name. Currently unused and set to a uuid.
track.after :: track.enabled
- Participant un-paused a track
track.after :: track.enabled
- Participant un-paused a trackstatus
{ String } The current status of the participant generating this event - eitherconnected
ordisconnected
.accountId
{ ObjectID } The id of the account generating the event.trackKind
{ String } The kind of track -data
,audio
orvideo
.trackName
{ String } The track name. Currently unused and set to a uuid.
track.after :: track.disabled
- Participant paused a track
track.after :: track.disabled
- Participant paused a trackstatus
{ String } The current status of the participant generating this event - eitherconnected
ordisconnected
.accountId
{ ObjectID } The id of the account generating the event.trackKind
{ String } The kind of track -data
,audio
orvideo
.trackName
{ String } The track name. Currently unused and set to a uuid.
Configuring Access
The Room definition defaultAcl
is owner.delete
and there is no createAcl
defined for Rooms; Rooms must be created in-script using bypassCreateAcl()
.
Alternatively, the Room definition may be extended with overriding createAcl
, defaultAcl
and - incidentally - custom properties.
Access to instances is provided using explicit acl
writing. the shorthand import/export format can be used as well as the standard type
, target
, allow
properties. Anyone with read
access to the room instance is provided a token when reading the token
property. For example:
Creating Rooms
Some environment-level options are required to create rooms.
org.configuration.televisit.roomsEnabled
must be true in order to create rooms in an environment.org.configuration.televisit.maxConcurrentRooms
determines how many open rooms are allowed in a given environment.
To see current values for the above read current environment as an administrator (return org.read('configuration.televisit')
)
To create a room instance, write an acl and insert a room instance:
The Cortex room instance is now created and the state
is "new"
. The provider room to which clients connect is opened asynchronously. Once this process has completed, the room's state
property will be set to "open"
and fire any room.after
script triggers ({type: 'room', name: 'created', ...}
).
Participant may now use their tokens to connect to the remote room.
Participant Status
Current participant status is updated in the Room instance to reflect the state of connected participants as they connect, disconnect, add and pause tracks, etc. Participant status is updated prior to script triggers so the latest is available in room event triggers.
Example participants list where both are connected and streaming audio and video.
The
status
of the participant isconnected
when they are connected to the room.The
audio
andvideo
are arrays that containconnected
and/orpaused
.When either of these tracks are removed,
connected
will no longer appear in the array, butpaused
may linger andshould be ignored.
When a participant status is
disconnected
:Ignore the values in
audio
andvideo
.The participant remains in the list.
Last updated