Represents media stream.
- Source:
- See:
Methods
(static) getLogger() → {Object}
Get stream logger
- Source:
Returns:
Logger
- Type
- Object
(inner) available() → {Promise}
Сhecks the availability of stream on the server
- Source:
Returns:
Resolves if is stream available, otherwise rejects
- Type
- Promise
(inner) fullScreen()
Request full screen for player stream
- Source:
(inner) getAudioState()
Get audio state (muted)
- Source:
Returns:
AudioState
(inner) getErrorInfo() → {string}
Get stream error info
- Source:
Returns:
Error info
- Type
- string
(inner) getInfo() → {string}
Get stream info
- Source:
Returns:
Info
- Type
- string
(inner) getNetworkBandwidth() → {number}
Get network bandwidth reported by server, works only for subscribe Stream
- Source:
Returns:
Network bandwidth in bps or -1
- Type
- number
(inner) getRecordInfo() → {string}
Get record file name
- Source:
Returns:
File name
- Type
- string
(inner) getRemoteBitrate() → {number}
Get remote bitrate reported by server, works only for subscribe Stream
- Source:
Returns:
Remote bitrate in bps or -1
- Type
- number
(inner) getStats(callbackFn, nativeStats) → {Object}
Get statistics
Parameters:
Name | Type | Description |
---|---|---|
callbackFn |
callbackFn | The callback that handles response |
nativeStats |
Boolean | If true, use native browser statistics |
- Source:
Returns:
Stream audio\video statistics
- Type
- Object
(inner) getVideoState()
Get video state (muted)
- Source:
Returns:
VideoState
(inner) getVolume() → {number}
Get current volume
- Source:
Returns:
Volume or -1 if audio is not available
- Type
- number
(inner) id() → {string}
Get stream id.
- Source:
Returns:
Stream id
- Type
- string
(inner) isAudioMuted() → {boolean}
Check outgoing audio mute state
- Source:
Returns:
True if audio is muted or not available
- Type
- boolean
(inner) isRemoteAudioMuted()
Is remote audio muted
- Source:
(inner) isVideoMuted() → {boolean}
Check outgoing video mute state
- Source:
Returns:
True if video is muted or not available
- Type
- boolean
(inner) muteAudio()
Mute outgoing audio
- Source:
(inner) muteRemoteAudio()
Mute remote audio
- Source:
(inner) muteVideo()
Mute outgoing video
- Source:
(inner) name() → {string}
Get stream name.
- Source:
Returns:
Stream name
- Type
- string
(inner) on(event, callback) → {Stream}
Add stream status event callback.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | One of Flashphoner.constants.STREAM_STATUS events |
callback |
Stream~eventCallback | Callback function |
- Source:
Throws:
-
-
Error if event is not specified
- Type
- TypeError
-
-
-
Error if callback is not a valid function
- Type
- Error
-
Returns:
Stream callback was attached to
- Type
- Stream
(inner) play()
Play stream.
- Source:
Throws:
-
Error if stream status is not Flashphoner.constants.STREAM_STATUS.NEW
- Type
- Error
(inner) publish()
Publish stream.
- Source:
Throws:
-
Error if stream status is not Flashphoner.constants.STREAM_STATUS.NEW
- Type
- Error
(inner) published() → {Boolean}
Is stream published.
- Source:
Returns:
True if stream published, otherwise false
- Type
- Boolean
(inner) sendData(payload)
Send data from published stream.
Parameters:
Name | Type | Description |
---|---|---|
payload |
Object | Any object |
- Source:
Throws:
-
Error if stream status is not Flashphoner.constants.STREAM_STATUS.PUBLISHING
- Type
- Error
(inner) setMicrophoneGain()
Set Microphone Gain
- Source:
Throws:
-
Error if stream status is not Flashphoner.constants.STREAM_STATUS.PUBLISHING
- Type
- Error
(inner) setVolume(volume)
Set volume of remote media
Parameters:
Name | Type | Description |
---|---|---|
volume |
number | Volume between 0 and 100 |
- Source:
(inner) snapshot()
Request remote stream snapshot.
- Source:
Throws:
-
Error if stream status is not Flashphoner.constants.STREAM_STATUS.NEW
- Type
- Error
(inner) status() → {string}
Get stream status.
- Source:
Returns:
- Type
- string
(inner) stop()
Stop stream.
- Source:
(inner) switchCam()
Switch camera in real-time.
Works only with WebRTC
- Source:
Throws:
-
Error if stream status is not Flashphoner.constants.STREAM_STATUS.PUBLISHING
- Type
- Error
(inner) switchMic()
Switch microphone in real-time.
Works only with WebRTC
- Source:
Throws:
-
Error if stream status is not Flashphoner.constants.STREAM_STATUS.PUBLISHING
- Type
- Error
(inner) switchToCam()
Switch to cam in real-time.
Works only with WebRTC
- Source:
Throws:
-
Error if stream status is not Flashphoner.constants.STREAM_STATUS.PUBLISHING
- Type
- Error
(inner) switchToScreen(source, woExtension)
Switch to screen in real-time.
Works only with WebRTC
Parameters:
Name | Type | Description |
---|---|---|
source |
String | Screen sharing source (for firefox) |
woExtension |
Boolean | Screen sharing without extension (for chrome) |
- Source:
Throws:
-
Error if stream status is not Flashphoner.constants.STREAM_STATUS.PUBLISHING
- Type
- Error
(inner) unmuteAudio()
Unmute outgoing audio
- Source:
(inner) unmuteRemoteAudio()
Unmute remote audio
- Source:
(inner) unmuteVideo()
Unmute outgoing video
- Source:
(inner) videoResolution() → {Object}
Get stream video size
- Source:
Returns:
Video size
- Type
- Object
Type Definitions
eventCallback(stream)
Stream status event callback.
Parameters:
Name | Type | Description |
---|---|---|
stream |
Stream | Stream that corresponds to the event |
- Source: