function removeTrack(trackId) {
  let sender = null;
  let otherSenderHasTrack = false;
  peerConnection_().getSenders().forEach(function(s) {
    if (s.track && s.track.id == trackId) {
      if (!sender)
        sender = s;
      else
        otherSenderHasTrack = true;
    }
  });
  if (!sender)
    throw failTest('There is no sender for track ' + trackId);
  peerConnection_().removeTrack(sender);
  if (sender.track)
    throw failTest('sender.track was not nulled by removeTrack.');
  returnToTest('ok-sender-removed');
}
/**
 * Calls |removeTrack| with the first sender that has the track with |trackId|
 * and verifies the SDP is updated accordingly.
 *
 * Returns "ok-sender-removed" on success.
 */
Calls |removeTrack| with the first sender that has the track with |trackId|
and verifies the SDP is updated accordingly.

Returns "ok-sender-removed" on success.
Calls |removeTrack| with the first sender that has the track with |trackId| and verifies the SDP is updated accordingly . Returns " ok - sender - removed " on success .
function removeTrack(trackId) {
  let sender = null;
  let otherSenderHasTrack = false;
  peerConnection_().getSenders().forEach(function(s) {
    if (s.track && s.track.id == trackId) {
      if (!sender)
        sender = s;
      else
        otherSenderHasTrack = true;
    }
  });
  if (!sender)
    throw failTest('There is no sender for track ' + trackId);
  peerConnection_().removeTrack(sender);
  if (sender.track)
    throw failTest('sender.track was not nulled by removeTrack.');
  returnToTest('ok-sender-removed');
}
function removeTrack ( trackId ) { let sender = null ; let otherSenderHasTrack = false ; peerConnection_ ( ) . getSenders ( ) . forEach ( function ( s ) { if ( s . track && s . track . id == trackId ) { if ( ! sender ) sender = s ; else otherSenderHasTrack = true ; } } ) ; if ( ! sender ) throw failTest ( 'There is no sender for track ' + trackId ) ; peerConnection_ ( ) . removeTrack ( sender ) ; if ( sender . track ) throw failTest ( 'sender.track was not nulled by removeTrack.' ) ; returnToTest ( 'ok-sender-removed' ) ; }
Calls |removeTrack| with the first sender that has the track with |trackId|
 and verifies the SDP is updated accordingly.
Calls |removeTrack| with the first sender that has the track with |trackId| and verifies the SDP is updated accordingly .