Re: [webrtc-pc] Tweak MediaStreamTrack.onunmute: at decode, not reception (#3076)

tl;dr: defining this in terms of RTP packets is wrong, this should be defined in terms of (video) frames or (audio) samples.

https://w3c.github.io/webrtc-pc/#simple-peer-to-peer-example
setting srcObject in onunmute is not something I have seen actual applications do. Always set srcObject on ontrack but show the video element once media arrives (or the connection is established) to avoid empty black boxes. See below.

> "[whenever an RTCRtpReceiver receives data on an RTP source](https://w3c.github.io/webrtc-pc/#mediastreamtrack-network-use)"

is woefully underspecified. Does it mean that a fec/retransmission packet, a single packet that is part of a video frame or an empty payload RTP packet triggers unmute? That would be ... odd.

The video use-case for unmute is still as it was [in 2018](https://blog.mozilla.org/webrtc/when-should-you-display-incoming-webrtc-video/). This is useful if you have a conference and want to show an avatar instead of a black (or frozen) frame so knowing when there is an update is useful (and avoids glitches compared to signaling this over the signaling channel). Likewise for mute, the app can replace the video at that point.

For audio unmute is not a useful signal. When the NetEQ jitter buffer does not receive packets it will emit silence or comfort noise. This is useful and intentional. Applications are polling getSynchronizationSources for audio levels to show an indication whether someone is speaking.

So while for video the [track is muted in response to remote replaceTrack](https://jsfiddle.net/fippo/1kj3xnqu/3/), the same is [not true for audio](https://jsfiddle.net/fippo/1kj3xnqu/4/).


I'd tweak getSynchronizationSources() too and remove the mention of RTP packets. The decoded frames have a RTP timestamp associated with them which should be used for sorting. The source of those frames is not relevant.

-- 
GitHub Notification of comment by fippo
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/3076#issuecomment-3345988058 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 29 September 2025 09:39:36 UTC