- Source:
Namespaces
Methods
(static) connect(options) → {Promise.<(void|Error)>}
Connect to server.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | SFU options
Properties
|
- 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
(static) room(options) → {FlashphonerSFU.Room}
Create room
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Room options
Properties
|
- 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
|
- 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 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: