Call this interface to delete a specified stream from a room. Unlike Kick a user out of a room, this interface is used to force a user to stop streaming while they are still in the room. It can also be used to remove an added CDN live stream in a "watch together" scenario.
This interface is only used to notify the deletion of a stream in the room and does not actually stop the streaming. Developers need to call the stopPublishingStream
interface from their own client to stop streaming and stop transmitting audio and video data to the media server. The corresponding player needs to call the stopPlayingStream
interface to stop receiving audio and video data from the media server.
On the client side, the ZEGO Express SDK will trigger the following callback to notify the client of the event:
Platform | ZEGO Express SDK callback |
---|---|
iOS/macOS | onRoomStreamUpdate |
Android | onRoomStreamUpdate |
Windows | onRoomStreamUpdate |
Web | roomStreamUpdate |
Listed below are the parameters specific to this request and part of the public request parameters. For the complete list of public request parameters, see Server APIs public request parameters.
Parameter | Type | Required | Description |
---|---|---|---|
RoomId |
String |
Yes |
Room ID. |
UserId |
String |
Yes |
User ID of the user who performs this operation. |
UserName |
String |
No |
User name of the user who performs this operation. |
StreamId |
String |
Yes |
Stream ID of the stream to be deleted. |
When calling this server-side API:
https://rtc-api.zego.im/?Action=DeleteStream
&RoomId=room1
&UserId=user1
&UserName=userName
&StreamId=streamId1
&<Public Request Parameters>
Parameter | Type | Description |
---|---|---|
Code |
Int32 |
Return code. |
Message |
String |
Description of the request execution result. |
RequestId |
String |
Request ID. |
{
"Code":0,
"Message":"success",
"RequestId":"5885338326725063742"
}
Listed below are the return codes related to this API. For the complete list of return codes, see Return codes.
Return Code | Description | Suggested Action |
---|---|---|
124 | Failed to delete stream information. | Please retry or contact ZEGOCLOUD technical support for assistance. |
138 | Stream information does not exist. | Please retry or contact ZEGOCLOUD technical support for assistance. |