All Products
Search
Document Center

ApsaraVideo Live:Automatic stream ingest and pulling

Last Updated:Jan 19, 2024

The ARTC SDK provides the automatic stream ingest and pulling feature. By default, the feature is enabled. The automatic stream ingest and pulling feature allows your apps to implement audio and video stream ingest and pulling by calling operations for joining meetings, leaving meetings, and switching roles. This topic describes how the automatic stream ingest and pulling feature works and provides sample code.

Sample code:

Disable automatic stream ingest and pulling operations

The ARTC SDK allows you to disable audio and video stream ingest and pulling for your apps based on your business requirements.

Disable automatic audio and video stream ingest

  • Sample code for Android:

    /* If you set the parameter to false, video streams are not ingested after a user joins the meeting. The app needs to call the operation to ingest video streams. * /
    /* If you set the parameter to true, video streams are ingested after a user joins the meeting. Default value: true. * /
    mAliRtcEngine.publishLocalVideoStream(false);
    /* If you set the parameter to false, audio streams are not ingested after a user joins the meeting. The app needs to call the operation to ingest audio streams. * /
    /* If you set the parameter to true, audio streams are ingested after a user joins the meeting. Default value: true. * /
    mAliRtcEngine.publishLocalAudioStream(false);
  • Sample code for iOS:

    /* If you set the parameter to NO, video streams are not ingested after a user joins the meeting. The app needs to call the operation to ingest video streams. * /
    /* If you set the parameter to YES, video streams are ingested after a user joins the meeting. Default value: YES. * /
    [self.engine publishLocalVideoStream:NO];
    /* If you set the parameter to NO, audio streams are not ingested after a user joins the meeting. The app needs to call the operation to ingest audio streams. * /
    /* If you set the parameter to YES, audio streams are ingested after a user joins the meeting. Default value: YES. * /
    [self.engine publishLocalAudioStream:NO];

Disable automatic audio and video stream pulling

  • Sample code for Android:

    /* If you set the parameter to false, video streams are not subscribed to after a user joins the meeting. The app needs to call the subscribeRemoteMediaStream or subscribeRemoteVideoStream operation to subscribe to video streams. * /
    /* If you set the parameter to true, video streams are subscribed to after a user joins the meeting. Default value: true. * /
    mAliRtcEngine.setDefaultSubscribeAllRemoteVideoStreams(false);
    /* If you set the parameter to false, audio streams are not subscribed to after a user joins the meeting. The app needs to call the subscribeRemoteMediaStream or subscribeRemoteAudioStream operation to subscribe to audio streams. * /
    /* If you set the parameter to true, audio streams are subscribed to after a user joins the meeting. Default value: true. * /
    mAliRtcEngine.setDefaultSubscribeAllRemoteAudioStreams(false);
  • Sample code for iOS:

    /* If you set the parameter to NO, video streams are not subscribed to after a user joins the meeting. The app needs to call the subscribeRemoteMediaStream or subscribeRemoteVideoStream operation to subscribe to video streams. * /
    /* If you set the parameter to YES, video streams are subscribed to after a user joins the meeting. Default value: true. * /
    [self.engine setDefaultSubscribeAllRemoteVideoStreams:NO];
    /* If you set the parameter to NO, audio streams are not subscribed to after a user joins the meeting. The app needs to call the subscribeRemoteMediaStream or subscribeRemoteAudioStream operation to subscribe to audio streams. * /
    /* If you set the parameter to YES, audio streams are subscribed to after a user joins the meeting. Default value: YES. * /
    [self.engine setDefaultSubscribeAllRemoteAudioStreams:NO];