Unsere Freiwilligen haben diesen Artikel noch nicht in Deutsch übersetzt. Machen Sie mit und helfen Sie, das zu erledigen!
Sie können den Artikel auch auf English (US) lesen.

The RTCPeerConnection.removeTrack() method tells the local end of the connection to stop sending media from the specified track, without actually removing the corresponding RTCRtpSender from the list of senders as reported by RTCPeerConnection.getSenders(). If the track is already stopped, or is not in the connection's senders list, this method has no effect.

If the connection has already been negotiated (signalingState is set to "stable"), it is marked as needing to be negotiated again; the remote peer won't experience the change until this negotiation occurs. A negotiationneeded event is sent to the RTCPeerConnection to let the local end know this negotiation must occur.




A RTCRtpSender specifying the sender to remove from the connection.

Return value



The connection is not open.


This example adds a video track to a connection and sets up a listener on a close button which removes the track when the user clicks the button.

var pc, sender;
navigator.getUserMedia({video: true}, function(stream) {
  pc = new RTCPeerConnection();
  var track = stream.getVideoTracks()[0];
  sender = pc.addTrack(track, stream);

document.getElementById("closeButton").addEventListener("click", function(event) {
}, false);


Specification Status Comment
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCPeerConnection.removeTrack()' in that specification.
Candidate Recommendation Initial specification.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
removeTrackChrome Full support 64Edge Full support YesFirefox Full support 22IE ? Opera Full support 51Safari Full support 11WebView Android Full support 64Chrome Android Full support 64Edge Mobile Full support YesFirefox Android Full support 44Opera Android Full support 47Safari iOS Full support YesSamsung Internet Android Full support 6.0


Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also

Schlagwörter des Dokuments und Mitwirkende

Mitwirkende an dieser Seite: mdnwebdocs-bot, fscholz, Sheppy, jpmedley, Gerwin, Jib
Zuletzt aktualisiert von: mdnwebdocs-bot,