What happens when the Agora client who started RTMP live stream disconnects?

Viewed 278

Let's say Client A starts live stream to CDN using RTMP and the for some reason User A gets disconnected. May be Internet failure or complete browser close. What happens to live stream ? Will it be cut off or continue ? If it continues, how can the client again gain control of the stream ? i.e. change layout, stop stream, etc

1 Answers

Pushing streams to the CDN refers to the process where a host publishes multiple media streams to the CDN (Content Delivery Network).

During pushing streams, the SDK connects to the dedicated Agora server for pushing streams. When the connection is interrupted, the SDK tries to reconnect to the server to continue pushing streams. If it fails to reconnect, the SDK triggers a callback to report a disconnection.

Based on live transcoding setting, the SDK connects to different servers for pushing streams and triggers different callbacks after disconnection:

  • Client.on("mix-streaming-disconnected")
  • Client.on("raw-streaming-disconnected")

When either of the previously-mentioned events occurs, call stopLiveStreaming to stop pushing all streams, and then startLiveStreaming to restart the process.

Agora Documentation Link: https://docs.agora.io/en/Interactive%20Broadcast/faq/live_streaming_disconnection_web

Related