doc: update README and comments

This commit is contained in:
Simon Chan 2023-01-20 14:03:09 +08:00
parent 849cb0c7fc
commit 9fc6360032
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
7 changed files with 54 additions and 17 deletions

View file

@ -6,8 +6,8 @@ It has no dependencies and high performance, but is only available on recent ver
**WARNING:** The public API is UNSTABLE. If you have any questions, please open an issue.
- [Compatibility](#compatibility)
- [Usage](#usage)
- [Compatibility](#compatibility)
- [Usage](#usage)
## Compatibility
@ -17,13 +17,13 @@ It has no dependencies and high performance, but is only available on recent ver
## Usage
It draws frames onto `decoder.element` (a `<canvas>` element), you can insert it anywhere you want to display the video.
It draws frames onto `decoder.renderer` (a `<canvas>` element), you can insert it anywhere you want to display the video.
```ts
const decoder = new WebCodecsDecoder();
document.body.appendChild(decoder.element);
document.body.appendChild(decoder.renderer);
videoPacketStream // from `@yume-chan/scrcpy`
.pipeTo(decoder.writable)
.catch(() => { });
.catch(() => {});
```

View file

@ -1,7 +1,7 @@
{
"name": "@yume-chan/scrcpy-decoder-webcodecs",
"version": "0.0.17",
"description": "TypeScript implementation of Scrcpy.",
"description": "Raw H.264 stream decoder and renderer using WebCodecs API (requires modern browser).",
"keywords": [
"adb",
"android-phone",