-
|
I would like to implement ability to mute and unmute track based on example. Thats how I try to mute the track: let id_for_remove = 1;
let media_kind_for_remove = MediaKind::Autio;
for client in clients.iter_mut() {
client.tracks_out.retain(|to| {
if let Some(track_in) =
to.track_in.clone().upgrade()
{
if track_in.kind == media_kind_for_remove
&& track_in.origin == id_for_remove
{
false
} else {
true
}
} else {
true
}
});
}And this is good works for Audio, but if I try to do the same thing for the video, the video is corrupted. What should I do to restore the video? Just send PLI to publisher? How to do that correctly? Should I change somehow timestamp/sequence number of rtp packages? |
Beta Was this translation helpful? Give feedback.
Answered by
algesten
Nov 20, 2025
Replies: 1 comment 4 replies
-
|
To fully mute, you'd change the direction on a Media/m-line to Javascript side initiates mute
str0m side initiates mute
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In many hardware, you have an LED that shows your camera is on, which means "muting" the camera should also turn off the LED. If this is the case, you probably want to stop the media on the client side.
On an RTP level there isn't a way to signal "mute". You could stop sending media (or forward RTP packets), but that will force the other side initially send NACK/FIR/PLI, however it will give up in time.
Another option is to have some ersatz media that is "blank"/"silence" that you insert instead. It's easy enough with audio, and more complex with video.
Request keyframe using the writer on the receiver side.
Are you using str0m in RTP mode or not?