Red5 Documentation

WHIPClient Publisher Events

WHIPClient Events

The following events are specific to the WHIPClient:

Access Event Type Meaning
CONNECT_SUCCESS ‘Connect.Success’ When the publisher has established a required remote connection, such as to a WebSocket or RTMP-based server.
CONNECT_FAILURE ‘Connect.Failure’ When the publisher has failed to establish a required remote connection for streaming.
PUBLISH_START ‘Publish.Start’ When the publisher has started a broadcast stream.
PUBLISH_FAIL ‘Publish.Fail’ When the publisher has failed to start a broadcast stream.
PUBLISH_INVALID_NAME ‘Publish.InvalidName’ When the publisher is rejected from starting a broadcast stream because the streamName provided is already in use.
UNPUBLISH_SUCCESS ‘Unpublish.Success’ When the publisher has successfully closed an active broadcast stream.
PUBLISH_METADATA ‘Publish.Metadata’ When the publisher receives metadata from the server.
PUBLISH_STATUS ‘Publish.Status’ When a status event of the publisher has been receieved from the server.
PUBLISH_AVAILABLE ‘Publish.Available’ When the publisher stream has become available on the origin server to be consumed. This will follow the connection setup and Publish.Start event.
PUBLISH_INSUFFICIENT_BANDWIDTH ‘Publish.InsufficientBW’ When the current broadcast session is experiencing insufficient bandwidth conditions.
PUBLISH_RECOVERING_BANDWIDTH ‘Publish.RecoveringBW’ Then the current broadcast has updated information related to bandwidth condition recovery.
PUBLISH_SUFFICIENT_BANDWIDTH ‘Publish.SufficientBW’ When the current broadcast session has sufficient bandwidth conditions from previously experiencing network issues.
CONNECTION_CLOSED ‘Publisher.Connection.Closed’ Invoked when a close to the connection is detected.
DIMENSION_CHANGE ‘Publisher.Video.DimensionChange’ Notification when the Camera resolution has been set or change.
STATISTICS_ENDPOINT_CHANGE ‘Publisher.StatisticsEndpoint.Change’ Notification that the server has signaled a change in endpoint to deliver WebRTC Statistics based on RTCStatsReports. Statistics are only reported after calling monitorStats.

In addition to the above events, the following events are also dispatched from a WHIPClient and are defined on the RTCPublisherEventTypes enum:

Access Event Type Meaning
CONSTRAINTS_ACCEPTED ‘WebRTC.MediaConstraints.Accepted’ When constraints have been accepted from the internal request to getUserMedia. The data property of this event contains a requested object detailing the constraints used in the getUserMedia request and an accepted object which is the current constraint settings for the media.
CONSTRAINTS_REJECTED ‘WebRTC.MediaConstraints.Rejected’ Then constraints have been rejected from the internal request to getUserMedia. The data property of this event contains a constraints object detailing the constraints that were used and rejected from getUserMedia.
MEDIA_STREAM_AVAILABLE ‘WebRTC.MediaStream.Available’ When the negotation process has returned a MediaStream object to use.
PEER_CONNECTION_AVAILABLE ‘WebRTC.PeerConnection.Available’ When the negotation process has produced a valid PeerConnection.
OFFER_START ‘WebRTC.Offer.Start’ When the publisher requests to send an offer using a SessionDescription on the PeerConnection.
OFFER_END ‘WebRTC.Offer.End’ When the publisher has received an answer from the SDP offer on the PeerConnection.
CANDIDATE_CREATE ‘WebRTC.Candidate.Create’ When the publisher requests to send a candidate on the PeerConnection.
CANDIDATE_RECEIVE ‘WebRTC.Candidate.Receive’ When the publisher has received a candidate over the PeerConnection.
ICE_TRICKLE_COMPLETE ‘WebRTC.IceTrickle.Complete’ When the negotaiton process (a.k.a. trickle) has completed and the publisher will attempt at opening a broadcast stream.
DATA_CHANNEL_AVAILABLE ‘WebRTC.DataChannel.Available’ the underlying RTCDataChannel is available when signalingSocketOnly configuration is used.
DATA_CHANNEL_OPEN ‘WebRTC.DataChannel.Open’ When the underlying RTCDataChannel is opened when signalingSocketOnly configuration is used.
DATA_CHANNEL_CLOSE ‘WebRTC.DataChannel.Close’ When the underlying RTCDataChannel is closed when signalingSocketOnly configuration is used.
DATA_CHANNEL_ERROR ‘WebRTC.DataChannel.Error’ When an error has occurred within the underlying RTCDataChannel when signalingSocketOnly configuration is used.
DATA_CHANNEL_MESSAGE ‘WebRTC.DataChannel.Message’ When a message has been delivered over the underlying RTCDataChannel when signalingSocketOnly configuration is used.
STATS_REPORT ‘WebRTC.Stats.Report’ An RTCStatsReport has been captured by the WebRTC client based on configurations from calling monitorStats.