RtmpStreamPublishState

RTMP stream publishing state.

Enumerations

RtmpStreamPublishStateIdle
0: Stream publishing not started or already ended.
RtmpStreamPublishStateConnecting
1: Connecting to the streaming server and CDN server.
RtmpStreamPublishStateRunning
2: Stream publishing is in progress. This state is returned after successful publishing.
RtmpStreamPublishStateRecovering
3: Recovering stream publishing. When the CDN encounters an exception or the stream is briefly interrupted, the SDK automatically attempts to recover the stream and returns this state.
  • If recovery is successful, it enters the RtmpStreamPublishStateRunning(2) state.
  • If the server encounters an error or recovery fails within 60 seconds, it enters the RtmpStreamPublishStateFailure(4) state. If 60 seconds is too long, you can also try to reconnect manually.
RtmpStreamPublishStateFailure
4: Stream publishing failed. After failure, you can troubleshoot the issue using the returned error code.
RtmpStreamPublishStateDisconnecting
5: The SDK is disconnecting from the streaming server and CDN server. When you call the stopRtmpStream method to end the stream normally, the SDK sequentially reports the stream states as RtmpStreamPublishStateDisconnecting and RtmpStreamPublishStateIdle.