Revamp WebCodecs documentation#43697
Conversation
dalecurtis
left a comment
There was a problem hiding this comment.
Generally lgtm. Thanks for doing this!
|
I hope to look at this next week, if @dipikabh doesn't beat me to it. |
548aa18 to
c2409b5
Compare
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
@dipikabh @wbamberg If you want to have a look and comment you are welcome to so - but please be aware that I expect to give this a final read over and likely merge on Friday. @sb2702 I've scanned the changes you made since my last review and they look good. I'd like to scan it with all the changes in place. Should be Friday. |
|
@hamishwillee Thanks a lot for reviewing these updates! |
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
| - PCM | ||
| - : Uncompressed audio. No quality loss, but large file sizes. | ||
|
|
||
| The WebCodecs specification supports a particular set of codecs, and individual devices and browsers may only support a subset of those. Encoders and decoders must be configured with fully specified codec strings (such as `"vp09.00.40.08.00"` for VP9 or `"avc1.4d0034"` for H.264) instead of ambiguous codec names like `"vp9"` or `"h264"`. The [Codec selection guide](/en-US/docs/Web/API/WebCodecs_API/Codec_selection) provides guidance on choosing an appropriate codec string (see the [Codec Support Table](https://webcodecsfundamentals.org/datasets/codec-support-table/) (webcodecsfundamentals.org) for a complete list of codec strings and their browser support). |
There was a problem hiding this comment.
[mdn-linter] reported by reviewdog 🐶
| The WebCodecs specification supports a particular set of codecs, and individual devices and browsers may only support a subset of those. Encoders and decoders must be configured with fully specified codec strings (such as `"vp09.00.40.08.00"` for VP9 or `"avc1.4d0034"` for H.264) instead of ambiguous codec names like `"vp9"` or `"h264"`. The [Codec selection guide](/en-US/docs/Web/API/WebCodecs_API/Codec_selection) provides guidance on choosing an appropriate codec string (see the [Codec Support Table](https://webcodecsfundamentals.org/datasets/codec-support-table/) (webcodecsfundamentals.org) for a complete list of codec strings and their browser support). | |
| The WebCodecs specification supports a particular set of codecs, and individual devices and browsers may only support a subset of those. Encoders and decoders must be configured with fully specified codec strings (such as `"vp09.00.40.08.00"` for VP9 or `"avc1.4d0034"` for H.264) instead of ambiguous codec names like `"vp9"` or `"h264"`. The [Codec selection guide](/en-US/docs/Web/API/WebCodecs_API/Codec_selection) provides guidance on choosing an appropriate codec string (see the [Codec Support Table](https://webcodecsfundamentals.org/datasets/codec-support-table/) (webcodecsfundamentals.org) for a complete list of codec strings and their browser support). |
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
hamishwillee
left a comment
There was a problem hiding this comment.
I've scan read through this again. I started doing a few minor tweaks then realized this was mosly grammar - so ran Claude as a grammar checker.
I'm not an expert by any means but this matches my understanding of the domain. The structure is good and so is the flow.
Upshot, is that I am happy with this. It is clearly much better than what it replaces. Thank you @sb2702 !!!
Description
As per this discussion, I have revamped the WebCodecs documentation by documenting the high level concepts of the core WebCodecs API, as well as adding 3 specific guides:
Motivation
The existing WebCodecs documentation is very sparse and bare compared to other APIs. Having developed WebCodecs applications for several years, the existing docs are not sufficient as practical guides to using the API.
I built https://webcodecsfundamentals.org/, an actual real-world guide to building production WebCodecs applications, both from my experience and with contributions from other devs who've built popular WebCodecs libraries, which is already referenced in MDN and by Chrome Developer Blog and CanIUse.
The motivation for this PR is to actually put the most substantive, core WebCodecs documentation on MDN itself, including pragmatic, core bits of information such as the need to manage
encoder.encodeQueueSizewhich is not documented anywhere, but which is critical for avoiding application crashes when working with WebCodecs.Additional details
The underlying discussion
Related issues and pull requests