RTCRtpTransceiver.stop()
The stop()
method in the RTCRtpTransceiver
interface permanently stops the transceiver by stopping both the associated RTCRtpSender
and RTCRtpReceiver
.
Note: Until recently, the stopped
property was provided to return true
if the connection is stopped. That property has been deprecated and will be removed at some point. Instead, check the value of currentDirection
. If it's stopped
, the transceiver has been stopped.
This method does nothing if the transceiver is already stopped.
Syntax
RTCRtpTransceiver.stop()
Parameters
None.
Return value
undefined
Exceptions
InvalidStateError
-
The
RTCPeerConnection
of which the transceiver is a member is closed.
Usage notes
When you call stop()
on a transceiver, the sender immediately stops sending media and each of its RTP streams are closed using the RTCP "BYE"
message. The receiver then stops receiving media; the receiver's track
is stopped, and the transceiver's direction
is changed to stopped
, and renegotiation is triggered by sending a negotiationneeded
event to the RTCPeerConnection
.
The negotiation process causes currentNegotiation
to be set to stopped
, finally indicating that the transceiver has been fully stopped.
Note: Stopping the transceiver causes a negotiationneeded
event to be sent to the transceiver's RTCPeerConnection
, so the connection can adapt to the change.
Specifications
Specification |
---|
WebRTC 1.0: Real-Time Communication Between Browsers (WebRTC 1.0) # dom-rtcrtptransceiver-stop |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
stop |
88 |
88 |
59 |
No |
No |
11 |
88 |
88 |
59 |
No |
11 |
15.0 |
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpTransceiver/stop