screencapture
Prompt the user to share a screen, window, or tab via the Screen Capture API.
Import: @rtorcato/browser-common/screencapture
getDisplayMedia needs a secure context and throws where unsupported — guard with isScreenCaptureAvailable() first.
Example
import { isScreenCaptureAvailable, getDisplayMedia } from '@rtorcato/browser-common/screencapture'
if (isScreenCaptureAvailable()) {
const stream = await getDisplayMedia({ video: true })
}
Exports
isScreenCaptureAvailable()— feature checkgetDisplayMedia(options?)— prompts the user and resolves to aMediaStream
See the API reference for full signatures.