Namespace: Room

FlashphonerSFU.Room

Source:

Methods

(static) assignRole(nickname, role)

Assign user a role. Note that this will only work with FlashphonerSFUExtended
Parameters:
Name Type Description
nickname String Nickname of the participant
role FlashphonerSFU.SFU_PARTICIPANT_ROLE Role to assign
Source:

(static) authorizeWaitingList(userId, authorized)

Authorize user that is currently resides in waiting room. Note that this will only work with FlashphonerSFUExtended
Parameters:
Name Type Description
userId String User id
authorized Boolean If true participant will move to the main room otherwise participant will be evicted.
Source:

(static) changeQuality(trackId, quality, tid)

Change receiving quality of the simulcast track.
Parameters:
Name Type Description
trackId String Id of the track
quality String one of qualities advertised in FlashphonerSFU.Room.TrackInfo
tid String In some tracks (Such as WebRTC simulcast VP8 track) there is an option of changing FPS of the track by changing TID. At the time of writing there were 3 TIDs (lower TID = lower FPS) 0|1|2
Source:

(static) configureWaitingRoom(enabled)

Turn waiting room on/off
Parameters:
Name Type Description
enabled Boolean Boolean flag
Source:

(static) destroyRoom()

Destroys room instance at server side.
Source:

(static) join(configopt)

Join room.
Parameters:
Name Type Attributes Description
config Object <optional>
Config for track marking. Key is a track id and value is a String (e.g. screen_sharing, camera, front_camera). The specified value will be available for other participants as contentType in FlashphonerSFU.Room.TrackInfo
Source:

(static) leaveRoom()

Leave room.
Source:

(static) moveToWaitingRoom(nickname)

Move user from room into waiting room. Note that this will only work with FlashphonerSFUExtended
Parameters:
Name Type Description
nickname String Participant nickname
Source:

(static) muteTrack(trackId, mute)

Mute track. Mute takes place at server side - server stops forwarding this track.
Parameters:
Name Type Description
trackId String Id of the track
mute Boolean Mute flag
Source:

(static) off(event, callback) → {FlashphonerSFU.Room}

Remove room event callback.
Parameters:
Name Type Description
event String One of FlashphonerSFU.SFU_ROOM_EVENT events
callback FlashphonerSFU.Room~eventCallback Callback function
Source:
Throws:
  • Error if event is not specified
    Type
    TypeError
  • Error if callback is not a valid function
    Type
    Error
Returns:
SDK instance callback was removed from
Type
FlashphonerSFU.Room

(static) on(event, callback) → {FlashphonerSFU.Room}

Add room event callback.
Parameters:
Name Type Description
event String One of FlashphonerSFU.SFU_ROOM_EVENT events
callback FlashphonerSFU.Room~eventCallback Callback function
Source:
Throws:
  • Error if event is not specified
    Type
    TypeError
  • Error if callback is not a valid function
    Type
    Error
Returns:
SDK instance callback was attached to
Type
FlashphonerSFU.Room

(static) sendMessage(msg)

Broadcast message to participants currently in the Room. This method will use DataChannels.
Parameters:
Name Type Description
msg String
Source:

(static) subscribeToWaitingParticipant(nickname)

Subscribe to tracks of participant that is currently resides in waiting room. New tracks will have `info.waitingRoom` flag set to true, see FlashphonerSFU.Room.TracksInfo. Note that this will only work with FlashphonerSFUExtended
Parameters:
Name Type Description
nickname String Nickname of the participant
Source:

(static) unsubscribeFromWaitingParticipant(nickname)

Unsubscribe from tracks of participant that is currently resides in waiting room. Note that this will only work with FlashphonerSFUExtended
Parameters:
Name Type Description
nickname String Nickname of the participant
Source:

(static) updateState(configopt)

Update state after adding tracks to PeerConnection. This method kicks off sdp renegotiation.
Parameters:
Name Type Attributes Description
config Object <optional>
Config for track marking. Key is a track id and value is a String (e.g. screen_sharing, camera, front_camera). The specified value will be available for other participants as contentType in FlashphonerSFU.Room.TrackInfo
Source:
Throws:
Error if peer connection is being negotiated
Type
Error

Type Definitions

Message

Properties:
Name Type Description
message String message body
nickName String nickname of the sender
Source:

OperationFailedInfo

Properties:
Name Type Description
error String error name
info String details about the error
operation FlashphonerSFUExtended.SFU_OPERATIONS Specifies operation that failed
roomName String room name
type String Event type
Source:

ParticipantInfo

Properties:
Name Type Description
name String nickname of participant
roomName String room name
type String Event type
Source:

ParticipantList

Properties:
Name Type Description
participants Array.<String> array with nicknames
roomName String room name
type String Event type
Source:

QualityInfo

Properties:
Name Type Description
quality String quality id
available Boolean true if quality is available
Source:

RoleInfo

Properties:
Name Type Description
name String nickname
role FlashphonerSFU.SFU_PARTICIPANT_ROLE new role
roomName String room name
type String Event type
Source:

TrackInfo

Properties:
Name Type Description
id String track id
contentType String content type that was advertised by content creator
mid String mid of the track
mute Boolean true if track is muted at server side
quality Array.<String> array of advertised quality types
type FlashphonerSFU.SFU_TRACK_TYPE track type
Source:

TrackQualityInfo

Properties:
Name Type Description
mid String track mid
quality Array.<FlashphonerSFU.Room.QualityInfo> all advertised qualities of this track
Source:

TracksInfo

Properties:
Name Type Description
info Object tracks info
Properties
Name Type Description
nickName String nickname of the owner of the tracks
waitingRoom Boolean true if this track belongs to waiting room
info Array.<FlashphonerSFU.Room.TrackInfo> details of each track
type String Event type
roomName String name of the Room this data corresponds to
Source:

TracksQualityInfo

Properties:
Name Type Description
roomName String room name
type String Event type
info Object
Properties
Name Type Description
nickName String nickname
tracks Array.<FlashphonerSFU.Room.TrackQualityInfo>
Source:

WaitingList

Properties:
Name Type Description
roomName String room name
type String event type
users Array.<FlashphonerSFUExtended.UserListEntry>
Source:

eventCallback(sdk)

Room event callback.
Parameters:
Name Type Description
sdk FlashphonerSFU.Room instance FlashphonerSFU.Room
Source: