Represents connection to REST App.
Can create and store Streams.
- Source:
- See:
Methods
(static) getLogger() → {Object}
Get session logger
- Source:
Returns:
Logger
- Type
- Object
(inner) createCall(options, sdpHook) → {Call}
Create call.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Call options
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sdpHook |
sdpHook | The callback that handles sdp from the server |
- Source:
Throws:
-
-
Error if no options provided
- Type
- TypeError
-
-
-
Error if session state is not REGISTERED
- Type
- Error
-
Returns:
Call
- Type
- Call
(inner) createStream(options, sdpHook) → {Stream}
Create stream.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Stream options
Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sdpHook |
sdpHook | The callback that handles sdp from the server |
- Source:
Throws:
-
-
Error if no options provided
- Type
- TypeError
-
-
-
Error if options.name is not specified
- Type
- TypeError
-
-
-
Error if session state is not ESTABLISHED
- Type
- Error
-
Returns:
Stream
- Type
- Stream
(inner) disconnect()
Disconnect session.
- Source:
(inner) getServerUrl() → {string}
Get server address
- Source:
Returns:
Server url
- Type
- string
(inner) getStream(streamId) → {Stream}
Get stream by id.
Parameters:
Name | Type | Description |
---|---|---|
streamId |
string | Stream id |
- Source:
Returns:
Stream
- Type
- Stream
(inner) getStreams() → {Array.<Stream>}
Get streams.
- Source:
Returns:
Streams
- Type
- Array.<Stream>
(inner) id() → {string}
Get session id
- Source:
Returns:
session id
- Type
- string
(inner) on(event, callback) → {Session}
Add session event callback.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | One of Flashphoner.constants.SESSION_STATUS events |
callback |
Session~eventCallback | Callback function |
- Source:
Throws:
-
-
Error if event is not specified
- Type
- TypeError
-
-
-
Error if callback is not a valid function
- Type
- Error
-
Returns:
Session
- Type
- Session
(inner) sendData(data) → {Promise}
Send data to REST App
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | Object to send |
- Source:
Returns:
Resolves if data accepted, otherwise rejects
- Type
- Promise
(inner) startDebug()
Start session debug
- Source:
(inner) status() → {string}
Get session status
- Source:
Returns:
- Type
- string
(inner) stopDebug()
Stop session debug
- Source:
(inner) submitBugReport(reportObject)
Submit bug report.
Parameters:
Name | Type | Description |
---|---|---|
reportObject |
Object | Report object |
- Source:
Type Definitions
eventCallback(session)
Session event callback.
Parameters:
Name | Type | Description |
---|---|---|
session |
Session | Session that corresponds to the event |
- Source: