Mute or unmute streaming
Updated
Mutes or unmutes the audio of a current Media Gateway stream.
https://api.agora.io/{region}/{version}/projects/{appId}/rtls/ingress/online-streams/mute/{sid}Use this method to mute or unmute the current streaming.
Path Parameters
regionstringRegion for the streaming key or stream. Supported values are na for North America, eu for Europe, ap for Asia except mainland China, and cn for mainland China.
Important
Make sure that:
- The
regionvalue is the same as for the input source stream. - The domain names for setting the
regionparameter and streaming are the same. - The
regionvalue is in lowercase.
versionstringThe API version. Use v1.
appIdstringThe app ID provided by Agora to each developer. After creating a project in Agora Console, you can get an app ID. The app ID is a unique identifier for a project.
sidstringThe streaming session ID. Each initiated streaming task generates a unique SID.
Header Parameters
X-Request-IDstringThe UUID (Universally Unique Identifier) of the request. After you pass in this field, the Agora server returns this field in the response header. It is recommended to assign X-Request-ID a value. If omitted, the Agora server automatically generates a UUID and returns it.
Request Body
application/json
settingsobjectvideoMutedbooleanWhether to mute the video stream. true mutes video publishing; false unmutes video publishing.
audioMutedbooleanWhether to mute the audio stream. true mutes audio publishing; false unmutes audio publishing.
Response Body
The request succeeded and sent the mute/unmute command.
Response Headers
statusstringThe status of this request. success means the request succeeds.
Note
-
The successful execution of this request only confirms that the command is sent to the gateway node handling the stream; it does not guarantee that the mute/unmute operation was successful. The operation is executed asynchronously in the background.
-
Typically, the mute/unmute action takes effect within approximately one second. If the operation does not work as expected, retry the API call.
-
By default, each stream starts unmuted (audio and video are published normally). Each API call applies to the current stream. If the streamer disconnects and restarts the stream, the new stream resets to the initial unmuted state.
Request examples
curl --request post \ --url https://api.sd-rtn.com/:region/:version/projects/:appId/rtls/ingress/online-streams/mute/:sid \ --header 'Authorization: Basic <credentials>' \ --header 'X-Request-ID: <string>' \ --data '{ "settings": { "videoMuted": true, "audioMuted": false }}'Response example
{ "status": "success"}