Disabled MediaStreamTrack sends no data
See original GitHub issueExpected behavior
When a MediaStreamTrack
is muted, it should continue sending either black frames if video, or silent frames if audio. This is the default implementation in Chrome/Webkit/etc., and is also mandated by the standard. In https://w3c.github.io/mediacapture-main/#life-cycle-and-media-flow:
Applications are able to enable or disable a MediaStreamTrack to prevent it from rendering media from the source. A muted track will however, regardless of the enabled state, render silence and blackness. A disabled track is logically equivalent to a muted track, from a consumer point of view.
Also:
Enabled/disabled on the other hand is available to the application to control (and observe) via the enabled attribute.
The result for the consumer is the same in the sense that whenever MediaStreamTrack is muted or disabled (or both) the consumer gets zero-information-content, which means silence for audio and black frames for video. In other words, media from the source only flows when a MediaStreamTrack object is both unmuted and enabled. For example, a video element sourced by a muted or disabled MediaStreamTrack (contained in a MediaStream ), is playing but rendering blackness.
Observed behavior
when using react-native-webrtc, we noticed that disabling a track causes it to cease sending any information whatsoever. This is because of the following changes:
https://github.com/react-native-webrtc/react-native-webrtc/commit/1d831e17c1279a8051bc2b047c1297eede480656#diff-bf46ca521b9b533fee2c317a9d034e01 for iOS, and https://github.com/react-native-webrtc/react-native-webrtc/commit/47b3d5a7e85bc06466dd0b3c5f3c8b2528e9ae5d#diff-0c50b3d88b89df8825cac7857642bc29 on android.
It isn’t clear to me why these changes were made based on git history (I couldn’t find an issue that referenced the changes), but it’s definitely not compliant with with media capture spec.
Steps to reproduce the problem
Disable a MediaStreamTrack
Note that no frame data is sent for that track.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:18 (7 by maintainers)
Top GitHub Comments
No progress and no workaround that I’m aware of.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.