Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guest271314/screenshot
Screenshots
https://github.com/guest271314/screenshot
decoder javascript screen-capture screenshot vp8 webm webrtc
Last synced: 3 months ago
JSON representation
Screenshots
- Host: GitHub
- URL: https://github.com/guest271314/screenshot
- Owner: guest271314
- Created: 2020-11-02T04:21:23.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-11-23T17:15:23.000Z (about 1 year ago)
- Last Synced: 2023-11-23T18:26:18.230Z (about 1 year ago)
- Topics: decoder, javascript, screen-capture, screenshot, vp8, webm, webrtc
- Language: JavaScript
- Homepage:
- Size: 183 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# screenshot
`getDisplayMedia()` => `MediaRecorder()` => [VP8 - WebM JavaScript Decoder](https://github.com/dominikhlbg/vp8-webm-javascript-decoder) => `ImageData`Usage
```
(async _ => {
try {
const screenshots = await screenshot();
for (const screenshot of screenshots) {
// do stuff with ImageData
console.log(screenshot);
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
canvas.width = screenshot.width;
canvas.height = screenshot.height;
ctx.putImageData(screenshot, 0, 0);
document.body.appendChild(canvas);
}
} catch(e) {
throw e;
}
})()
.catch(e => {
console.error(e);
console.trace();
});
```Tested at Firefox 82, Nightly 84, Chromium 88.
TODO: Programmatically hide screen capture notification.
References
- [Screenshot (still image) capability #107](https://github.com/w3c/mediacapture-screen-share/issues/107)
- [capture screenshot of DOM #145](https://github.com/w3c/mediacapture-screen-share/issues/145)