Open Bug 1541471 (me-capture-stream) Opened 7 years ago Updated 6 months ago

[meta] Implement spec-compliant `HTMLMediaElement`.captureStream

Categories

(Core :: Audio/Video: MediaStreamGraph, enhancement, P3)

enhancement

Tracking

()

Tracking Status
firefox68 --- affected

People

(Reporter: padenot, Assigned: alwu)

References

(Depends on 3 open bugs, Blocks 5 open bugs, )

Details

(5 keywords)

User Story

https://mozilla-hub.atlassian.net/browse/FFXP-677
platform-scheduled:2026-06-30
user-impact-score:400

We have old and incorrect (per-spec) mozCaptureStream and mozCaptureStreamUntilEnded, that we should adjust and rename to be spec-compliant.

Type: defect → enhancement
Priority: -- → P3
Blocks: 1178751, 1336401
See Also: → 1183510
Blocks: 1541473

Fixing title because captureStreamUntilEnded was removed from the spec, since it is trivial to emulate with

video.onended = () => track.stop();
Summary: Implement spec-compliant `HTMLMediaElement`.{captureStream,captureStreamUntilEnded} → Implement spec-compliant `HTMLMediaElement`.captureStream

(In reply to Jan-Ivar Bruaroey [:jib] (needinfo? me) from comment #2)

Fixing title because captureStreamUntilEnded was removed from the spec, since it is trivial to emulate with

video.onended = () => track.stop();

Well, if the video element ended, there wouldn't be any live track left to stop. If you wanted to cancel the capturing you could probably do something with GC of the MediaStream that was returned from captureStream.

I think the safest way to emulate captureStreamUntilEnded would be to stop using the captured media element and replace it with a pristine one.

Depends on: 1592287
Depends on: 1592289
See Also: → 1734353
Severity: normal → S3
No longer blocks: webrtc-triage
User Story: (updated)
User Story: (updated)
No longer blocks: 1178751
Depends on: 1178751
User Story: (updated)
User Story: (updated)
User Story: (updated)

NI over to Alastor who has agreed to pick this work up.

Flags: needinfo?(alwu)

I’ll update my plan once I finish the investigation on this topic, keep my NI.

Assignee: nobody → alwu

I’m going to make this bug a meta bug. Currently, implementation notes for mozCaptureStream()` on MDN are incorrect, and those issues have now been fixed. The major noncompliance issue is that Firefox does not keep audio playout active while the stream is being captured.

I will first file bugs to address this issue, while keeping mozCaptureStreamXXX() unchanged to avoid breaking existing sites. After that, I’ll add a new implementation for captureStream() along with proper test coverage.

Flags: needinfo?(alwu)
Keywords: meta
Summary: Implement spec-compliant `HTMLMediaElement`.captureStream → [meta] Implement spec-compliant `HTMLMediaElement`.captureStream
Depends on: 2007596
Depends on: 1793248
Alias: capture-stream → me-capture-stream
Depends on: 1284389
Depends on: 917187
Depends on: 2008623
Depends on: 2009488
Depends on: 2009493
Depends on: 2011940
Depends on: 2013809
No longer depends on: 2013809
Depends on: 2014859
Depends on: 2016210
Depends on: 2016216
Depends on: 2010427
Depends on: 2017708
User Story: (updated)
User Story: (updated)
You need to log in before you can comment on or make changes to this bug.