Starting with Firefox 149, HTMLMediaElement.captureStream() will be enabled by default.
captureStream() allows capturing a MediaStream from <audio> and <video> elements, exposing their selected audio and video tracks as MediaStreamTrack objects.
The legacy, non-spec-compliant mozCaptureStream() and mozCaptureStreamUntilEnded() methods will remain temporarily available for compatibility but will be gradually deprecated.
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=2017708
Standard: https://w3c.github.io/mediacapture-fromelement/#dom-htmlmediaelement-capturestream
Pref: media.captureStream.enabled
Platform coverage: Available on all platforms.
Other browsers: Chromium-based browsers support captureStream(); Safari does not. See https://caniuse.com/mdn-api_htmlmediaelement_capturestream
Web Platform Tests:
https://wpt.fyi/results/mediacapture-fromelement?label=master&label=experimental&aligned&q=mediacapture-fromelement