Namespace: FlashphonerSFUExtended

FlashphonerSFUExtended

Namespaces

SFU_OPERATIONS

Methods

(static) connect(options) → {Promise.<(void|Error)>}

Connect to server.
Parameters:
Name Type Description
options Object SFU options
Properties
Name Type Attributes Description
url String Server url
username String Username
password String Password
nickname String <optional>
Participant's nickname
Source:
Throws:
Error if no options provided
Type
TypeError
Returns:
Promise which resolves upon connect
Type
Promise.<(void|Error)>

(static) disconnect()

Disconnect sfu from the server
Source:

(static) getUserList() → {Promise.<Array.<FlashphonerSFUExtended.UserListEntry>>}

Fetch available user list from server
Source:
Throws:
error if api isn't connected
Type
Error
Returns:
Type
Promise.<Array.<FlashphonerSFUExtended.UserListEntry>>

(static) on(event, callback) → {FlashphonerSFUExtended}

Add session event callback.
Parameters:
Name Type Description
event String One of FlashphonerSFU.SFU_EVENT events
callback FlashphonerSFUExtended~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
FlashphonerSFUExtended

(static) room(options) → {FlashphonerSFU.Room}

Create room
Parameters:
Name Type Description
options Object Room options
Properties
Name Type Description
name String Room name
pin String Room's pin
pc Object Peer connection
Source:
Throws:
  • Error if no options provided
    Type
    TypeError
  • error if api isn't connected
    Type
    Error
Returns:
Room
Type
FlashphonerSFU.Room

(static) sendMessage(msg) → {Promise}

Send message
Parameters:
Name Type Description
msg Object Message
Properties
Name Type Description
to String Recipient's id
body String Message body
Source:
Throws:
error if api isn't connected
Type
Error
Returns:
Promise will resolve upon message delivery and reject if delivery was unsuccessful
Type
Promise

(static) sfu.server() → {String}

Get hostname of the server in use
Source:
Returns:
Current server's hostname
Type
String

(static) sfu.user() → {FlashphonerSFUExtended.SFUUser}

Get current user
Source:
Returns:
Returns current logged in user
Type
FlashphonerSFUExtended.SFUUser

Type Definitions

Message

Properties:
Name Type Description
id String message id
from String username of the sender
to String username of the recipient
body String message payload
Source:

SFUUser

Type:
  • Object
Properties:
Name Type Description
username String username
nickname String nickname
Source:

UserListEntry

Type:
  • Object
Properties:
Name Type Description
id String username
nickname String nickname
state String ONLINE or OFFLINE
Source:

eventCallback(sdk)

FlashphonerSFUExtended event callback.
Parameters:
Name Type Description
sdk FlashphonerSFUExtended instance FlashphonerSFUExtended
Source: