The above is POC, and will probably end up with a dedicated function in membrane-webrtc-js.
The mute event is handled by TrackSender which sends %TrackVariantPaused{reason: :muted} events.
Upon receiving this events the TrackReceiver marks the currently active variant as muted_variant
The unmute event is sent from FE as well as the track being replaced with an actual video
The TrackSender sends TrackVariantResumed events to TrackReceiver
The VariantSelector within TrackReceiver requests the last paused variant, ignoring the limitation of the bandwidth, which at this point is probably 0.
I don't think that setting muted variant as inactive is possible. That's because both when switching to muted and inactive state we check whether the variant is in the active state first.
This allows for explicitly muting and then unmuting tracks.
The flow is as follows:
mute
event from frontend AND replace the track with null so no data is sent.This is how it looks like on the FE:
The above is POC, and will probably end up with a dedicated function in
membrane-webrtc-js
.mute
event is handled byTrackSender
which sends%TrackVariantPaused{reason: :muted}
events.TrackReceiver
marks the currently active variant asmuted_variant
unmute
event is sent from FE as well as the track being replaced with an actual videoTrackSender
sendsTrackVariantResumed
events toTrackReceiver
VariantSelector
withinTrackReceiver
requests the last paused variant, ignoring the limitation of the bandwidth, which at this point is probably 0.I don't think that setting
muted
variant asinactive
is possible. That's because both when switching tomuted
andinactive
state we check whether the variant is in theactive
state first.