By default, Agora Cloud Recording subscribes to all published audio and video streams in a channel. This feature enables you to create a whitelist or blacklist for audio and video subscriptions. You can also update the subscription lists during a cloud recording.
When the recording starts, set the parameters in start
to create subscription lists. During the recording, set the streamSubscribe
parameter in update
to update the subscription lists.
Use either of the following parameters to set up a subscription list for audio:
subscribeAudioUids
: Specify the users whose audio streams you want to subscribe to. The setting creates a whitelist for audio subscription.unSubscribeAudioUids
: Specify the users whose audio streams you do not want to subscribe to. The setting creates a blacklist for audio subscription.Use either of the following parameters to set up a subscription list for video:
subscribeVideoUids
: Specify the users whose video streams you want to subscribe to. The setting creates a whitelist for video subscription.unSubscribeVideoUids
: Specify the users whose video streams you do not want to subscribe to. The setting creates a blacklist for video subscription.Suppose that four users, whose user IDs are 111, 222, 333, and 444, are in a channel when the recording begins, and two more users with unknown user IDs join the channel during the recording. The following lists the typical scenarios and recommended settings:
Scenarios | Recommended settings |
---|---|
Subscribe to all audio and video streams. | You do not need to set up a subscription list. |
Subscribe to all audio streams and the video streams of 111 and 222. | subscribeAudioUids: ["#allstream#"] subscribeVideoUids: ["111","222"] |
Subscribe to all audio streams and the video streams of all user IDs except 111 and 222. | subscribeAudioUids: ["#allstream#"] unSubscribeVideoUids: ["111","222"] The recording service records the audio streams of all user IDs and the video streams of 333, 444, and the other two unknown user IDs. |
Subscribe to all audio streams but no video streams. | subscribeAudioUids: ["#allstream#"] Setting streamType to 0 leads to the same result. |
Subscribe to the audio streams of all user IDs except 222 and the video stream of 111. | unSubscribeAudioUids: ["222"] subscribeVideoUids: ["111"] The recording service records the audio streams of 111, 333, 444, and the other two unknown user IDs, and the video stream of 111. |
["#allstream#"]
to specify all user IDs in a channel.streamTypes
in recordingConfig
is set to 0
(audio only), you cannot set subscribeVideoUids
or unSubscribeVideoUids
; when streamTypes
in recordingConfig
is set to 1
(video only), you cannot set subscribeAudioUids
or unSubscribeAudioUids
.