Todos os produtos
Search
Central de documentação

ApsaraVideo Live:Ingestão e pull automáticos de streams

Última atualização: Nov 04, 2026

O Alibaba Real-Time Communication (ARTC) SDK ingere e faz pull automático de streams de áudio e vídeo quando um usuário entra em um canal, troca de função ou sai de um canal. Esse recurso vem ativado por padrão. Este tópico explica o funcionamento do recurso e fornece exemplos de código para desativá-lo.

Funcionamento

Nota
  • Em cenários apenas de áudio, somente streams de áudio são ingeridos e recebidos via pull.

  • Para cenários com áudio e vídeo, todos os streams configurados desses tipos passam pela ingestão e pelo pull.

image.png

Exemplos de código

API para desativar a ingestão e o pull automáticos de streams

Desative a ingestão e o pull automáticos de streams separadamente para controlar cada comportamento de forma independente.

Desativar a ingestão automática de streams de áudio e vídeo

Android

/* If you set the parameter to false, video streams are not subscribed to after a user joins the channel. Your app must call the SubscribeRemoteMediaStream or SubscribeRemoteVideoStream method to subscribe to video streams. */
/* If you set the parameter to true, video streams are immediately subscribed to after a user joins the channel. The default value is true. */
mAliRtcEngine.SetDefaultSubscribeAllRemoteVideoStreams(false);
/* If you set the parameter to false, audio streams are not subscribed to after a user joins the channel. Your app must call the SubscribeRemoteMediaStream or SubscribeRemoteAudioStream method to subscribe to audio streams. */
/* If you set the parameter to true, audio streams are immediately subscribed to after a user joins the channel. The default value is true. */
mAliRtcEngine.SetDefaultSubscribeAllRemoteAudioStreams(false);

iOS

/* If you set the parameter to false, video streams are not subscribed to after a user joins the channel. Your app must call the SubscribeRemoteMediaStream or SubscribeRemoteVideoStream method to subscribe to video streams. */
/* If you set the parameter to true, video streams are immediately subscribed to after a user joins the channel. The default value is true. */
mAliRtcEngine.SetDefaultSubscribeAllRemoteVideoStreams(false);
/* If you set the parameter to false, audio streams are not subscribed to after a user joins the channel. Your app must call the SubscribeRemoteMediaStream or SubscribeRemoteAudioStream method to subscribe to audio streams. */
/* If you set the parameter to true, audio streams are immediately subscribed to after a user joins the channel. The default value is true. */
mAliRtcEngine.SetDefaultSubscribeAllRemoteAudioStreams(false);

Windows

/* If you set the parameter to false, video streams are not subscribed to after a user joins the channel. Your app must call the SubscribeRemoteMediaStream or SubscribeRemoteVideoStream method to subscribe to video streams. */
/* If you set the parameter to true, video streams are immediately subscribed to after a user joins the channel. The default value is true. */
mAliRtcEngine.SetDefaultSubscribeAllRemoteVideoStreams(false);
/* If you set the parameter to false, audio streams are not subscribed to after a user joins the channel. Your app must call the SubscribeRemoteMediaStream or SubscribeRemoteAudioStream method to subscribe to audio streams. */
/* If you set the parameter to true, audio streams are immediately subscribed to after a user joins the channel. The default value is true. */
mAliRtcEngine.SetDefaultSubscribeAllRemoteAudioStreams(false);

Desativar o pull automático de streams de áudio e vídeo

Android

/* If you set the parameter to false, video streams are not subscribed to after a user joins the channel. Your app must call the SubscribeRemoteMediaStream or SubscribeRemoteVideoStream method to subscribe to video streams. */
/* If you set the parameter to true, video streams are immediately subscribed to after a user joins the channel. The default value is true. */
mAliRtcEngine.SetDefaultSubscribeAllRemoteVideoStreams(false);
/* If you set the parameter to false, audio streams are not subscribed to after a user joins the channel. Your app must call the SubscribeRemoteMediaStream or SubscribeRemoteAudioStream method to subscribe to audio streams. */
/* If you set the parameter to true, audio streams are immediately subscribed to after a user joins the channel. The default value is true. */
mAliRtcEngine.SetDefaultSubscribeAllRemoteAudioStreams(false);

iOS

/* If you set the parameter to false, video streams are not subscribed to after a user joins the channel. Your app must call the SubscribeRemoteMediaStream or SubscribeRemoteVideoStream method to subscribe to video streams. */
/* If you set the parameter to true, video streams are immediately subscribed to after a user joins the channel. The default value is true. */
mAliRtcEngine.SetDefaultSubscribeAllRemoteVideoStreams(false);
/* If you set the parameter to false, audio streams are not subscribed to after a user joins the channel. Your app must call the SubscribeRemoteMediaStream or SubscribeRemoteAudioStream method to subscribe to audio streams. */
/* If you set the parameter to true, audio streams are immediately subscribed to after a user joins the channel. The default value is true. */
mAliRtcEngine.SetDefaultSubscribeAllRemoteAudioStreams(false);

Windows

/* If you set the parameter to false, video streams are not subscribed to after a user joins the channel. Your app must call the SubscribeRemoteMediaStream or SubscribeRemoteVideoStream method to subscribe to video streams. */
/* If you set the parameter to true, video streams are immediately subscribed to after a user joins the channel. The default value is true. */
mAliRtcEngine.SetDefaultSubscribeAllRemoteVideoStreams(false);
/* If you set the parameter to false, audio streams are not subscribed to after a user joins the channel. Your app must call the SubscribeRemoteMediaStream or SubscribeRemoteAudioStream method to subscribe to audio streams. */
/* If you set the parameter to true, audio streams are immediately subscribed to after a user joins the channel. The default value is true. */
mAliRtcEngine.SetDefaultSubscribeAllRemoteAudioStreams(false);