Constructs a new Streamer instance, optionally with a custom connector This doesn't start the broadcast, you must call start() method
OptionalConnector: new (connectParams: Params, stream: MediaStream) => IConnectorConnector class to use for signaling, can be determined automatically from URL in the start() method
The current audio track of the stream, or null if audio track is disabled.
Returns the IConnector instance, or undefined if stream is not starting.
Returns the IController instance when starting with a connector with controllable ability, or undefined if stream is not starting or stream is not controllable.
Last MediaReport statistics
Returns true when streamer is running (between a Streamer.start and a Streamer.stop)
Camera media stream as specified by MediaStream
Stream name, for example as+bc3f535f-37f3-458b-8171-b4c5e77a6137
Video bitrate configured by the server, can be undefined on start or when there is no controllable connector
Use connectionInfos to get the current precise audio or video bitrate
Configure the video bitrate from the server, possible only if your Streamer instance is built with a controllable connector Set undefined to remove this configuration
Video bitrate constraint configured by the server, can be undefined on start or when there is no controllable connector
Use connectionInfos to get the current precise audio or video bitrate
The current video track of the stream, or null if video track is disabled.
Returns connection info, such as round trip time, requests sent and received, bytes sent and received, and bitrates NOTE: This call is resource-intensive for the CPU.
A promise for a ConnectionInfos
Event unsubscription
Name of event without the 'on' prefix (ex: 'log' to 'onLog' event declared)
Event subscription
Name of event without the on prefix (ex: log to onLog event declared)
Subscriber Function
Optionaloptions: { signal?: AbortSignal }Optionalsignal?: AbortSignalOptional AbortSignal to stop this or multiple subscriptions in same time
Event subscription only one time, once time fired it's automatically unsubscribe
Name of event without the on prefix (ex: log to onLog event declared)
Subscriber Function
Optionaloptions: { signal?: AbortSignal }Optionalsignal?: AbortSignalOptional AbortSignal to stop this or multiple subscriptions in same time
Event fired when a video bitrate change occurs
Replace the audio track while streaming.
MediaStreamTrack to set as audio track, or null to remove the audio track
A promise that resolves when the track is set or removed
Sets server properties for packet error (nack) and delayed packet loss (drop) and fires an onRTPProps event if changed successfully. NOTE: Method can also retrieve current server values if called without arguments.
Optionalnack: numberWaiting period before declaring a packet error
Optionaldrop: numberWaiting period before considering delayed packets as lost
Replace the video track while streaming.
MediaStreamTrack to set as video track, or null to remove the video track
A promise that resolves when the track is set or removed
Starts broadcasting the stream The connector is determined automatically from Connect.Params.endPoint if not forced in the constructor.
The adaptiveBitrate option can take three different types of value:
MediaStream instance to stream
Connection parameters
Adaptive bitrate implementation or ABRParams to configure the default implementation
Stop streaming the stream
Optionalerror: StreamerErrorerror description on an improper stop
Event fired when the stream has started
Event fired when the stream has stopped
Optionalerror: StreamerErrorerror description on an improper stop
Use Streamer to broadcast to a WebRTC server.
You can use a controllable version using a
WSControlleras connector, or change it to use aHTTPConnector(HTTP WHIP). By default it uses aWSControllerexcepting if on Streamer.start you use a Connect.Params.endPoint prefixed with ahttp://protocol. With a controllable connector you can change video bitrate during the streaming, what is not possible with a HTTP(WHIP) connector.Example