-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify unmute event must fire on receiver.track AFTER sRD(offer) succeeds #2880
Comments
Maybe that's not directly related to this issue but does it mean that there is no support for Early Media mentioned in this blog post. By Early Media I mean the ability of offerer to receive and display MediaStreamTrack before receiving remote SDP answer assuming that the offerer is willing to receive. Both the blog post I linked and JSEP RFC (section 3.2-4) mentions that the receive must be prepared to demux incoming streams before receiving remote SDP answer. I've created a simple jsfiddle that tries to accomplish this. The flow is as follows:
As a result, looking at chrome://webrtc-internals, I can see that the PC2 sends its audio track, PC1 receives this data on ICE candidate pair but it is not demuxed and no events like ontrack, onunmute etc. are fired. Also, nothing plays in the audio element. If we uncomment line 54 i.e. we do apply answer on PC1, PC1 successfully receives RTP stream. Is this intentional? If yes, why do we always need to create a transceiver with a receiver with a track? |
DTLS setup can't happen until offer/answer is completed, and before DTLS setup is complete, you don't have the keys to decrypt SRTP packets. It can in theory happen on subsequent offer/answer, however. When the WG discussed this in 2015 or so, it was considered "not so important we have to have extra code to accomodate it". |
Thanks! That was my suspection. That's for another discussion but if there is no support for early media, perhaps we could get rid of the requirement to always create receiver with a track. I know this would mean changes in |
Sorry I made a typo in the OP initially (now fixed):
It should have said:
IOW, the offerer is receptive in sLD(offer), allowing media to arrive from the answerer ahead of sRD(answer) on renegotiation (only), e.g. if the currentDirection is renegotiated from
The spec supports early media, so the model is not likely to change again, for that and other reasons, like the |
This invariant lets apps use
getReceivers()
to discover receivers added by sRD and attach event handlers in time. E.g:The spec already guarantees this:
IOW, since step 2 queues a task to fire the event, it happens AFTER the sRD success callback.
Unfortunately, none of the examples show this, and crbug 1295295 undermines this (fiddle above doesn't work in Chrome).
Shall we add an example and a note?
The text was updated successfully, but these errors were encountered: