- From: Peter Thatcher <pthatcher@google.com>
- Date: Tue, 12 Jan 2016 14:01:19 -0800
- To: "public-webrtc@w3.org" <public-webrtc@w3.org>
- Message-ID: <CAJrXDUH60exU54gnwa4bEhB43Jh0jOMsoW3D0Mx41-qJ+m4djg@mail.gmail.com>
I wrote PR 462 to add PeerConnection.activateSender https://github.com/w3c/webrtc-pc/pull/462 + <dt>void activeSender()</dt> + + <dd> + <p>The <dfn id="dom-rtptransceiver-activesender"><code>activateSender</code></dfn> + method actives the <code>RTCRtpTransceiver.sender</code> such that future calls + to <code>createOffer</code> and <code>createAnswer</code> to mark the corresponding + media description as <code>sendrecv</code> or <code>sendonly</code>, as defined in + [[!JSEP]]. + + <p>If the sender is not already active and the PeerConnection is in the stable state, + this will trigger <code>onnegotiationneeded</code>. + </dd> And I updated the media warmup example to use it: - // TODO: Figure out how to reuse an existing m-line with something like: - // audio = evt.transceiver; - // audio.sender.activate(); - // This avoids the need for an extra re-offer. - // Similarly for video. - audio = pc.addTransceiver(evt.track.kind); + audio = evt.transceiver; + audio.activateSender(); if (started && audioSendTrack) { audio.sender.replaceTrack(audioSendTrack); } } } else if (evt.track.kind === "video") { if (answerer) { - audio = pc.addTransceiver(evt.track.kind); + video = evt.transceiver; + video.activateSender();
Received on Tuesday, 12 January 2016 22:02:27 UTC