HTMLMediaElement.captureStream - add notes#29165
HTMLMediaElement.captureStream - add notes#29165hamishwillee wants to merge 1 commit intomdn:mainfrom
Conversation
| "version_added": "15", | ||
| "notes": [ | ||
| "From version 51 to version 148, if the source changes from a `MediaStream` after capture starts, the captured stream data cannot be updated until you switch the source back to a `MediaStream`.", | ||
| "From version 51 to version 148, if `mozCaptureMediaStream()` is called on a media element with a `MediaStream` source, the returned object only contains tracks while the element is playing a `MediaStream`.", | ||
| "From version 51 to version 148, if `mozCaptureMediaStream()` is called on a media element with no source media, its compatibility mode is be based on the first source that's added; and the stream will only work with that kind of stream from then on.", | ||
| "Prior to version 51, `mozCaptureMediaStream()` could not be used on a media element whose source is itself a `MediaStream` (such as a `<video>` element presenting a stream being received over an `RTCPeerConnection`)." | ||
| ] |
There was a problem hiding this comment.
Note, the text stripped out of the docs is:
Firefox-specific notes
Prior to Firefox 51, you couldn't use captureStream() on a media element whose source is, itself, a {{domxref("MediaStream")}} (like a {{HTMLElement("video")}} element which is presenting a stream being received over a {{domxref("RTCPeerConnection")}}).
From Firefox 51 you can capture a stream from the video element and use {{domxref("MediaRecorder")}} to record it.
Prior to Firefox 149 captureStream() was prefixed as mozCaptureStream() on Firefox, with the following implementation quirks:
- The Firefox implementation only matches the specification when the media element's source is, itself, a {{domxref("MediaStream")}}.
- For other source types the behavior is incompatible.
If the source changes after starting capture, the output capture stream can't accept the new source data, so no {{domxref("MediaStreamTrack")}}s from the new sourceMediaStreamare added to the captured stream, resulting in output that doesn't capture the updated source. - Switching the source back to a
MediaStreamadds tracks back to the stream and it works again as expected. - Calling
mozCaptureMediaStream()on an element with aMediaStreamsource returns a stream that only contains tracks while the element is playing aMediaStream. - If you call
mozCaptureMediaStream()on a media element with no source media, its compatibility mode will be based on the first source that's added; for example, if it's aMediaStream, then the capture stream will only work withMediaStreamsources from then on.
|
Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs). |
ddbeck
left a comment
There was a problem hiding this comment.
Hi @hamishwillee, we discussed this PR during PR triage on today's BCD call. I've left you some suggestions in line comments. Thank you!
| { | ||
| "prefix": "moz", | ||
| "version_added": "15" | ||
| "version_added": "15", |
There was a problem hiding this comment.
First, I'd suggest breaking this support statement in two, for a total of three support statements:
- Unprefixed, added 149 (no notes)
- Prefixed, added 149 (no notes)
- Prefixed, partially implemented, added 15, removed 149, with notes from the diff here.
Then I would apply the changes I propose to the notes below.
| "From version 51 to version 148, if the source changes from a `MediaStream` after capture starts, the captured stream data cannot be updated until you switch the source back to a `MediaStream`.", | ||
| "From version 51 to version 148, if `mozCaptureMediaStream()` is called on a media element with a `MediaStream` source, the returned object only contains tracks while the element is playing a `MediaStream`.", | ||
| "From version 51 to version 148, if `mozCaptureMediaStream()` is called on a media element with no source media, its compatibility mode is be based on the first source that's added; and the stream will only work with that kind of stream from then on.", |
There was a problem hiding this comment.
When this is broken into a partial_implementation support statement, these notes will start with:
From Firefox 51, if …
| "From version 51 to version 148, if the source changes from a `MediaStream` after capture starts, the captured stream data cannot be updated until you switch the source back to a `MediaStream`.", | ||
| "From version 51 to version 148, if `mozCaptureMediaStream()` is called on a media element with a `MediaStream` source, the returned object only contains tracks while the element is playing a `MediaStream`.", | ||
| "From version 51 to version 148, if `mozCaptureMediaStream()` is called on a media element with no source media, its compatibility mode is be based on the first source that's added; and the stream will only work with that kind of stream from then on.", | ||
| "Prior to version 51, `mozCaptureMediaStream()` could not be used on a media element whose source is itself a `MediaStream` (such as a `<video>` element presenting a stream being received over an `RTCPeerConnection`)." |
There was a problem hiding this comment.
This note will start with "Before Firefox 51"
FF149 adds support for
HTMLElement.captureStream()in https://bugzilla.mozilla.org/show_bug.cgi?id=2017708 - and this was recoreded in #29135.Previously only a non-standards-compliant version
mozCaptureSttream()was defined. The docs contained notes about the compliance issues. This attempts to move those to BCD, where they belong.Related work for this can be tracked in mdn/content#43215