URL to your backend. We send requests here to authenticate and get streaming tokens.
authenticationData (required)
Object
Your authentication data for the user. On every request, this will be sent to your backend through a HTTP POST request and all its attributes would be accessible on the request body.
onError (optional)
Function
Function to be called when authentication fails or a failure occurs that is unrecoverable.
authToken (optional)
String
The authentication token generated using the Phenix EdgeAuth library.
treatBackgroundAsOffline (optional)
Boolean
Treat background as offline. This is especially useful on iOS browsers where the network connection may be stopped when the browser is in background. This forces a reconnect upon entering foreground which can greatly improve the time to reconnect.
reAuthenticateOnForeground (optional)
Boolean
Re-authenticate when entering foreground. This will force the session and connection to be revalidated upon entering foreground. This is automatically set to true if the treatBackgroundAsOffline option is enabled.
Get PCast
Get the underlying instance from an already instantiated Room Express. This is preferred to creating another instance as this will introduce more overhead.
Publishing remote media from the WebSDK is deprecated. Remote media should be published using the REST API.
Publish from remote sources into the Phenix platform. This enables us to distribute your source media using the Phenix platform. After publishing users may subscribe to the stream using either pcast subscribe or express subscribe.
Number of consecutive "conditions" that can occur before the callback is triggered. A condition is counted whenever one of the below thresholds is violated.
frameRateThreshold
Number
2
Framerate below which the condition count is incremented (fps)
videoBitRateThreshold
Number
6000
Video bitrate below which the condition count is incremented (bps)
audioBitRateThreshold
Number
5000
Audio bitrate below which the condition count is incremented (bps)
monitoringInterval
Number
4000
When the state is healthy, how often to check the state (milliseconds)
conditionMonitoringInterval
Number
1500
After a condition, how often to check the state (milliseconds)
monitorFrameRate
Bool
true
Enable or disable the frameRateThreshold
monitorBitRate
Bool
true
Enable or disable the videoBitRateThreshold and audioBitRateThreshold
monitorState
Bool
true
Enable or disable monitoring of the native state of the RTCPeerConnection
Optionally returns Phenix renderer if videoElement option is passed in
retry
Function
Optionally returns a function to retry subscription if unable to start stream
Express Get User Media
Get local user media. Use for more granular control over requesting media and handling failure. We automatically resolve any constraint errors when getting the user media:
for a resolution issue (width or height): drop to the next closest resolution (resolution isn't supported on the requested device)
for a frame rate issue: remove the frame rate constraint (frame rate isn't supported on device)
for an aspect ratio issue: drop to next aspect ratio at highest requested resolution (aspect ratio at resolutions is not supported)
Any resolution may be passed. If we are unable to get the user media at that resolution we will drop to the next closest resolution at that aspect ratio in the table below. We will continue dropping to the next closest resolution until we run out of options or the user media is successfully received. Similarly, when all resolution options at an aspect ratio are exhausted we will attempt to resolve the highest resolution requested at the next lowest aspect ratio.
Aspect Ratio
Resolution (Longer dimension)
Shorter dimension
Description
9x16
1920
1080
1080p (FHD)
1366
768
1280
720
720p (HD)
1024
576
854
480
480p
640
360
360p (nHD)
320
180
3x4
1600
1200
UXGA
1440
1080
960
720
800
600
SVGA
768
576
640
480
VGA
480
360
320
240
QVGA
160
120
QQVGA
16x9
1080
1920
1080p (FHD)
768
1366
720
1280
720p (HD)
576
1024
480
854
480p
360
640
360p (nHD)
180
320
4x3
1200
1600
UXGA
1080
1440
720
960
600
800
SVGA
576
768
480
640
VGA
360
480
240
320
QVGA
120
160
QQVGA
Longer dimension is the width for landscape orientations and the height for portrait orientations. Shorter dimension is the height for landscape orientations and the width for portrait orientations. Portrait orientations are only supported by some browsers including newer versions of Chrome and Opera.
Supported Frame Rates
60, 30, 15, or any other value. If a frame rate is not resolved we will request media without the frame rate constraint.
Get PCast
Get the underlying instance of the PCast™. This is preferred to creating another instance as this will introduce more overhead.
JavaScript
1var pcast = pcastExpress.getPCast();
Clean up PCast
Dispose of all active connections and clean up all handlers.