Files
Xuezhou Dai 961028b1bf Add tabCapture sample (#933)
* Add tabCapture sample

* Add README

* Update receiver.html

* Fix variable loss caused by idle

* Use windows.create

* Remove unnecessary logs

* Update README

* Update api-samples/tabCapture/README.md

Co-authored-by: Oliver Dunk <oliver@oliverdunk.com>

* Update api-samples/tabCapture/README.md

Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>

* Update api-samples/tabCapture/README.md

Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>

* Update api-samples/tabCapture/README.md

Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>

* Rename background.js

* Remove unnecessary async function

* Move the script to the body

* Update api-samples/tabCapture/README.md

Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>

* Update README.md

* Update api-samples/tabCapture/manifest.json

Co-authored-by: Oliver Dunk <oliver@oliverdunk.com>

---------

Co-authored-by: Oliver Dunk <oliver@oliverdunk.com>
Co-authored-by: amysteamdev <37001393+AmySteam@users.noreply.github.com>
2023-06-01 10:51:54 +01:00
..
2023-06-01 10:51:54 +01:00
2023-06-01 10:51:54 +01:00
2023-06-01 10:51:54 +01:00
2023-06-01 10:51:54 +01:00
2023-06-01 10:51:54 +01:00
2023-06-01 10:51:54 +01:00

chrome.tabCapture

A sample that demonstrates how to use the chrome.tabCapture API.

Overview

In this sample, the chrome.tabCapture API captures the contents of the active tab. The captured stream is displayed in a new window.

Implementation Notes

Use tabCapture.getMediaStreamId to capture specific tabs.

The targetTabId and consumerTabId are obtained in the Service Worker, and then passed to the receiver page through the tabs.sendMessage method.

See the Audio recording and Screen capture guide for a more detailed implementation.

Running this extension

  1. Clone this repository.
  2. Load this directory in Chrome as an unpacked extension.
  3. Click the extension's action icon.