Skip to content

Latest commit

 

History

History
59 lines (36 loc) · 1.53 KB

File metadata and controls

59 lines (36 loc) · 1.53 KB

tabCapture

Documentation: Chrome Tab Capture API

A promise-based wrapper for the Chrome tabCapture API to capture and retrieve tab media streams.

Methods

Events


createTabCapture

createTabCapture(options: chrome.tabCapture.CaptureOptions): Promise<MediaStream | null>

Captures the visible media stream of a tab based on the specified options. Resolves with the MediaStream if successful, or null otherwise.

getCapturedTabs

getCapturedTabs(): Promise<chrome.tabCapture.CaptureInfo[]>

Retrieves details of all active tab capture sessions. Resolves with an array of CaptureInfo objects.

getCaptureMediaStreamId

getCaptureMediaStreamId(options: chrome.tabCapture.GetMediaStreamOptions): Promise<string>

Generates a media stream ID for capturing a tab via navigator.mediaDevices.getUserMedia. Resolves with the stream ID.

onCaptureStatusChanged

onCaptureStatusChanged(
  callback: (info: chrome.tabCapture.CaptureInfo) => void
): () => void

Adds a listener for tab capture status changes (started, stopped, source changed). Returns an unsubscribe function.