Documentation
Server_APIs_v2 Server APIs v2
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • Server APIs v2
  • Room signaling
  • Delete a stream from a room

Delete a stream from a room

Last updated:2024-08-08 18:30

1 Description

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

2 Request method and endpoint

  • Request method: GET
  • Request endpoint: https://rtc-api.zego.im/?Action=DeleteStream
  • Transmission protocol: HTTPS
  • Rate limit (Rooms with the same AppID): 10 requests/second (Testing environment: 1 requests/second)

3 Request parameters

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:

  • It is not recommended to use the same UserId as the actual users in the room to avoid conflicts with the stream removal behavior of the client SDK. You can use a specific name to identify server-side actions, for example: userId = "Server-Administrator".
  • If you use the same UserId as the actual users in the room (not recommended), the client of the corresponding operator UserId will not receive the stream removal callback triggered by this server-side API, but other users in the room will receive the stream removal callback.

4 Request example

https://rtc-api.zego.im/?Action=DeleteStream
 &RoomId=room1
 &UserId=user1
 &UserName=userName
 &StreamId=streamId1 
&<Public Request Parameters>

5 Response parameters

Parameter Type Description
Code
Int32
Return code.
Message
String
Description of the request execution result.
RequestId
String
Request ID.

6 Response example

{
    "Code":0,
    "Message":"success",
    "RequestId":"5885338326725063742"
}

7 Return codes

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.
Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code