Class: SFURoom

SFURoom

Class that manages SFU type room.

Methods

close()

Close PeerConnection and emit leave and close event.

getLog()

Start getting room's logs from signaling server.

replaceStream(newStream)

Replace the stream being sent with a new one.
Parameters:
Name Type Description
newStream MediaStream The stream to replace the old stream with.

send(data)

Send data to all participants in the room with WebSocket. It emits broadcast event.
Parameters:
Name Type Description
data * The data to send.

Events

close

All connections in the room has closed.

data

Data received from peer.
Type:
  • object
Properties:
Name Type Description
src string The peerId of the peer who sent the data.
data * The data that a peer sent in the room.

error

Error occured

log

Room's log received.
Type:
  • Array

open

Room is ready.

peerJoin

New peer has joined.
Type:
  • string

peerLeave

A peer has left.
Type:
  • string

stream

MediaStream received from peer in the room.
Type:
  • MediaStream