- Auto-subscribe—call
rtc_set_auto_subscribebefore joining, and the SDK subscribes to every remote track automatically. Use this for “take everything” scenarios such as recording, audio mixing, and AI integration - Manual subscription—pick the tracks you need in the track event callback and subscribe to them one by one
rtc_set_track_sample_callback callback.
rtc_subscribe_audio
Returns
rtc_subscribe_video
rtc_subscribe_audio; to subscribe to the video composite stream, pass RTC_MCU_PUBLISHER_UID / RTC_TRACK_MCU_ID.
There’s no separate function for subscribing to the composite stream (program); use the two general functions above with the reserved constants. See Composite stream (program).
rtc_unsubscribe
track_id. Return values are the same as above.
After you unsubscribe, the SDK automatically stops collecting data for that track, and the corresponding track_sample callbacks stop.
Manual subscription example
rtc_request_key_frame
Returns
When to call it
- You just subscribed to a video track and want video to appear as soon as possible
- The decoder reports errors, or the video is corrupted or gray, and you need to refresh the reference frame
You don’t need to request keyframes for packet loss. Light packet loss is recovered automatically by the SDK’s NACK retransmission and doesn’t corrupt the video. So the SDK doesn’t request keyframes based on packet loss rate, and we don’t recommend that you do—it only triggers unnecessary keyframes, which push up the bitrate and make congestion worse.Only call it when your decoder actually reports an error or the video is already corrupted.The function has built-in rate limiting (at most once per second), so calling it repeatedly on per-frame decode errors won’t flood requests.
Related
- How the publisher responds to keyframe requests: Publishing
- Multi-layer simulcast subscription and manual layer switching: SeaStart advanced features