声网提供两套回调供你监听旁路推流:
onStreamPublished
和 onStreamUnpublished
。onRtmpStreamingStateChanged
和 onRtmpStreamingEvent
。声网废弃旧回调并推荐你使用新回调。旧回调依然可用。你可以根据业务逻辑挑选一套回调使用。新旧回调的对应关系详见下表:
新回调 | 旧回调 |
---|---|
(自 v2.4.1)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_OK (0) | (自首个版本)onStreamPublished.ERR_OK (0) |
(自 v2.4.1)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT (1) | (自首个版本)onStreamPublished.ERR_INVALID_ARGUMENT (2) |
(自 v2.4.1)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED (2) | (自首个版本)onStreamPublished.ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH (130) |
(自 v2.4.1)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT (3) | (自首个版本)onStreamPublished.ERR_TIMEDOUT (10) |
(自 v2.4.1)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR (4) | (自首个版本)onStreamPublished.ERR_PUBLISH_STREAM_INTERNAL_SERVER_ERROR (154) |
(自 v2.4.1)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR (4) | (自首个版本)onStreamPublished.ERR_FAILED (1) |
(自 v2.4.1)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR (5) | (自 v2.4.1)onStreamPublished.ERR_PUBLISH_STREAM_CDN_ERROR (151) |
(自 v2.4.1)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT (7) | (自 v2.4.1)onStreamPublished.ERR_PUBLISH_STREAM_NUM_REACH_LIMIT (152) |
(自 v2.4.1)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED (8) | (自 v2.4.1)onStreamPublished.ERR_PUBLISH_STREAM_NOT_AUTHORIZED (153) |
(自 v2.4.1)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND (9) | (自 v2.4.1)onStreamPublished.ERR_PUBLISH_STREAM_NOT_FOUND (155) |
(自 v2.4.1)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED (10) | (自 v2.4.1)onStreamPublished.ERR_PUBLISH_STREAM_FORMAT_NOT_SUPPORTED (156) |
(自 v3.6.0)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_NOT_BROADCASTER (11) | 无对应回调 |
(自 v3.6.0)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_TRANSCODING_NO_MIX_STREAM (13) | 无对应回调 |
(自 v3.6.0)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_NET_DOWN (14) | 无对应回调 |
(自 v3.6.0)onRtmpStreamingStateChanged.RTMP_STREAM_PUBLISH_ERROR_INVALID_APPID (15) | 无对应回调 |
(自 v3.4.5)onRtmpStreamingStateChanged.RTMP_STREAM_UNPUBLISH_ERROR_OK (100) | (自首个版本)onStreamUnpublished |
(自 v3.1.0)onRtmpStreamingEvent.RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE (1) | 无对应回调 |
(自 v3.4.5)onRtmpStreamingEvent.RTMP_STREAMING_EVENT_URL_ALREADY_IN_USE (2) | (自首个版本)onStreamPublished.ERR_ALREADY_IN_USE (19) |
(自 v3.6.0)onRtmpStreamingEvent.RTMP_STREAMING_EVENT_ADVANCED_FEATURE_NOT_SUPPORT (3) | 无对应回调 |