Link Search Menu Expand Document

Properties

observer

Peer EventEmitter, emit peer events to your application

@returns EventEmitter readonly

id

Peer unique id

@returns String readonly

channelIds

Peer channel ids list

@returns String[] readonly

loginDate

Peer login date

@returns Date readonly

uid

Peer unique id provided in join params

@returns String readonly

appData

Peer application data provided in join params

@returns Record<string, unknown> readonly

Role

Peer role in channel, provided in join params

@returns Role readonly

isMe
@returns Boolean readonly

publishedMedia
@returns Publisher[] readonly

Methods

subscribe(producerId)

Create a PeerTrack for provided Publisher producerId. Must be called when receiving an event “media-published” from peer observer. Actual list of publishers you can view in peer.publishedMedia

Argument Type Description Required Default
producerId String   Yes  

@async
@throws Error subscribe media

Params

Publisher

Field Type Required
producerId String Yes
kind MediaKind Yes
label TrackLabel Yes

Observer Events

Name Payload Type
media-published publisher Publisher
media-unpublished publisher Publisher
connection-quality-changed connectionQuality ConnectionQuality
track-start track Track
track-end track Track
track-paused track Track
track-resumed track Track

Enums

ConnectionQuality

Value Description
BAD 1
MEDIUM 2
GOOD 3