Close a track

Close a local or remote track

Close media tracks identified by mids on the session in the URL. Closing a receiving track stops that subscription; closing a publishing track stops that source. A successful close of a bidirectional transceiver stops both directions. With force=false, provide an endpoint offer and apply the returned answer to complete negotiation. With force=true, no SDP exchange is required. Process each track result independently. A request-level failure can occur after individual tracks have closed.

put/apps/{appId}/sessions/{sessionId}/tracks/close

Request

  • Base URL: https://rtc.live.cloudflare.com/v1
  • URL: https://rtc.live.cloudflare.com/v1/apps/{appId}/sessions/{sessionId}/tracks/close
  • Auth: HTTP bearer

Path parameters

appIdstring required

WebRTC application ID

sessionIdstring required

Request body

forceboolean required

When true, stop the selected tracks' media flow without an SDP exchange. Closed records can remain in session information. When false, sessionDescription must contain the endpoint's offer; apply the returned answer before the next mutation. Packets already sent or buffered at endpoints are separate from future forwarding.

Response

OK

errorCodestring
errorDescriptionstring
requiresImmediateRenegotiationboolean

Track closure returns false. A negotiated close returns an answer for the endpoint to apply; a forced close does not return SDP. This does not describe the completion of any earlier exchange.

Changes

No recorded changes to this operation across all 1 revision of this API.