Skip to content

audio: use replaceTrack for "hard" mute #1009

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

Closed
wants to merge 1 commit into from
Closed

Conversation

fippo
Copy link
Collaborator

@fippo fippo commented Feb 3, 2018

Description
uses replaceTrack for hard muting. This is different from soft mute, i.e. setting track.enabled = false
which (in chrome) continues to send 50 packets/s at a slightly lower bitrate

Purpose
I want to use replaceTrack(null) so I would like to see some basic QA :-)

@henbos PTAL since you wanted this as well.
@KaptenJansson wdyt about adding "QA" instructions on the page?
@jan-ivar replaceTrack(null) is only supported in 59+, right? Graphs freeze after replaceTrack(null), afaics getStats() does not return any rtp stats?

uses replaceTrack for hard muting. This is different from soft mute, i.e.
setting track.enabled = false
@fippo
Copy link
Collaborator Author

fippo commented Feb 5, 2018

so in the "stage 2" model there is an issue. Suppose I have an audio/video connection. Then I replace both the audio and the video track with null.
Then I want to re-attach the audio track. How do I find it when using getSenders()? Since he have no track, we have no kind.

In the transceiver model this is pretty easy to solve. Iterate over getTransceivers(), find the sender where track is null and the receivers track.kind is audio.

Stuck in the middle.

@jan-ivar
Copy link
Member

jan-ivar commented Feb 5, 2018

I'm against this, because:

  1. It seems like a hack to work around one implementation not following spec recommendation.
  2. It undermines track.enabled as the spec-preferred API for muting,
  3. The concept of "soft"/"hard" mute is confusing, and
  4. It doesn't let browsers know whether cameras and microphones are still in use.

The samples should help guide people to using the spec, not work around Chrome bugs. I don't see that the "soft"/"hard" distinction serves any other purpose here.

The fourth point is important to us at Mozilla, because Firefox 60 now implements turning off the camera on mute, a key step to getting sites like Hangouts to stop using track.stop() for face mute (which causes unnecessary grief/redundant permission re-prompts for privacy-sensitive Firefox users).

which (in chrome) continues to send 50 packets/s at a slightly lower bitrate

This is a Chrome issue IMHO. Spec now says: "In the case of video, the RTCRtpSender SHOULD send one black frame per second."

@fippo
Copy link
Collaborator Author

fippo commented Feb 5, 2018

@jan-ivar i think you're more opposed to #996 then which shows that technique.

But we need some way to QA this and doing it here where we have both @KaptenJansson+crew and the general public prod at it...

@jan-ivar
Copy link
Member

jan-ivar commented Feb 5, 2018

How do I find it when using getSenders()? Since he have no track, we have no kind.

I suggest storing them as videoSender and audioSender.

Copy link
Member

@henbos henbos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed the discussion on this issue...

@fippo
Copy link
Collaborator Author

fippo commented Feb 13, 2018

probably move this stuff to https://github.com/webrtc/test-pages

fippo added a commit to fippo/test-pages that referenced this pull request Feb 13, 2018
based on pc1 sample and the following two PRs:
  webrtc/samples#1009
  webrtc/samples#996
@fippo fippo deleted the moar-qa branch October 8, 2018 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants