Skip to content
Cloudflare Docs

RTKParticipantMap

This is a map of participants, indexed by participant.id (a participant's peer ID). This map emits an event whenever a participant present in the map emits an event. For example, when a participant is added to this map, a participantJoined event is emitted from the map. When a participant object emits an event videoUpdate, the map re-emits that event (provided the participant is present in the map).

module.exports ⏏

Kind: Exported class

new module.exports(logger, [options])

ParamType
loggerLogger
[options]MapEvents

module.exports.add(participant, [emitEvent])

Kind: instance method of module.exports

ParamTypeDefault
participantT
[emitEvent]booleantrue

module.exports.clear([emitEvent], [removeListeners])

Kind: instance method of module.exports

ParamTypeDefault
[emitEvent]booleantrue
[removeListeners]booleanfalse

module.exports.delete(participantId, [emitEvent], [removeListeners])

Kind: instance method of module.exports

ParamTypeDefault
participantIdstring
[emitEvent]booleantrue
[removeListeners]booleanfalse