All Community

When pushing streams to the CDN, what should I do when a disconnection happens?

Type: Integration issues    Platform: Web   Last Updated: 2020/12/23 00:12:36
This article only applies to the Agora Web SDK 3.x and earlier versions.

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.

enableTranscoding Callback triggered when a disconnection happens
true Client.on("mix-streaming-disconnected")
false 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.