The WebRTC Screen Capture API lets a web page ask a user to choose a browser tab, application window, or display, then receive the selection as a MediaStream. Call navigator.mediaDevices.getDisplayMedia() from a secure, user-initiated action, attach the returned video track to an RTCPeerConnection, and handle the user stopping or denying the share. The browser—not your constraints—controls which source the user can select.
What the WebRTC Screen Capture API does
The API is centered on MediaDevices.getDisplayMedia(), specified by the W3C Screen Capture specification. A successful call resolves to a MediaStream. You can preview it in a video element, record it, or send its tracks through WebRTC.
The current W3C document is a Working Draft dated 27 August 2026 and warns that it is incomplete and may change. Treat browser behavior as an implementation detail to verify against current compatibility data when you deploy.
Minimal working example
This complete page starts capture only after a button click, previews the stream locally, sends the video track to a peer connection, and reacts when sharing ends.
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
- 【1080P 60FPS Video Capture Card】 This HDMI game capture card is based on USB3.0 high speed transmission port, input resolution up to 4K@30HZ, output resolution up to 2K@30Hz or 1920×1080@60Hz. Type c and USB interface can meet most of the devices in daily life. Easily meet the online capture, real-time recording, online meetings, live gaming and other functions, so you have a better visual enjoyment. Note: For capture use only; requires capture software to function and is not intended for direct screen casting to a monitor or TV
- 【Ultra Low Latency Screen Sharing】 HDMI capture card is made of good quality aluminum alloy with strong heat dissipation, allowing you to enjoy ultra low latency while live gaming or video recording or live streaming, avoiding blue screens and lag. This HDMI to USBC capture card supports easy recording of good quality audio or HD video and transferring it to your computer or streaming platform, allowing you to record 60 fps HD video directly on your hard drive and real-time preview
- 【Plug and Play, Easy to Carry】 This HDMI 1080P video capture card does not require any additional drivers or external power supply, just plug and play for fast capture. The capture card is small and lightweight, so you can put it in your bag for emergencies, making it very portable for outdoor live streaming. It's also a great way to share content in game recording, video conference, video recorder and online teaching
- 【Wide Compatibility USB Capture Card】 Easily streams to Facebook, Youtube or Twitch. With the connection, this HDMI to USB C/3.0 video capture devices can be working on several Operating Systems and various software: Windows 7/ 8/ 10, Mac OS or above, Linux, Android, Laptop, Xbox One, PS3/PS4/PS5, Camera, DVDs, Set Top Box, Webcame, DSLR, Switch/Switch 2, TV BOX, HDTV, Potplayer/VLC, ZOOM, OBS Studio etc.
- 【Package Content & Note】 1x HD Audio Capture Card , 1x USB 3.0 to USB C Adapter (A-side 3.0, B-side 2.0), 1x user manual. Please note that you need to restart the OBS Studio software after the audio setup is complete, otherwise it will result in no sound output. When using an adapter, if the device is recognized as USB 2.0, try using the other side with the USB-C port. Simply flip the capture card and reconnect it to be recognized as USB 3.0
<button id="share">Share screen</button>
<button id="stop" disabled>Stop sharing</button>
<video id="preview" autoplay muted playsinline></video>
<p id="status" role="status"></p>
<script>
const shareButton = document.querySelector('#share');
const stopButton = document.querySelector('#stop');
const preview = document.querySelector('#preview');
const status = document.querySelector('#status');
const peer = new RTCPeerConnection();
let displayStream;
shareButton.addEventListener('click', async () => {
try {
displayStream = await navigator.mediaDevices.getDisplayMedia({
video: true,
audio: false
});
preview.srcObject = displayStream;
const [videoTrack] = displayStream.getVideoTracks();
peer.addTrack(videoTrack, displayStream);
videoTrack.addEventListener('ended', () => {
preview.srcObject = null;
shareButton.disabled = false;
stopButton.disabled = true;
status.textContent = 'Screen sharing stopped.';
});
shareButton.disabled = true;
stopButton.disabled = false;
status.textContent = 'You are sharing your selected display surface.';
} catch (error) {
status.textContent = `${error.name}: ${error.message}`;
}
});
stopButton.addEventListener('click', () => {
displayStream?.getTracks().forEach(track => track.stop());
});
</script>
In a real call, complete your normal WebRTC signaling and offer/answer exchange after addTrack(). The capture API supplies media; it does not provide signaling, a server, or a remote video element.
Requirements before calling getDisplayMedia()
Use a secure context
Serve the page over HTTPS. During local development, browsers commonly treat localhost as trustworthy, but test the exact deployment origin you will use. If navigator.mediaDevices is unavailable, check the context before debugging WebRTC.
Require recent user interaction
Invoke the method directly from a button or other recent user gesture. A timer, page-load handler, or delayed promise chain can be rejected. The browser must present a picker each time; a site cannot silently reuse a permanent display-capture grant.
Allow the document under Permissions Policy
The default display-capture allowlist is self. If you set a Permissions-Policy header or embed the app, permit the feature explicitly:
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesPermissions-Policy: display-capture=(self "https://app.example")
An iframe can also use an allow attribute:
<iframe src="https://app.example" allow="display-capture"></iframe>
Policy permission only makes the API available. The user still chooses the surface and can cancel. A disabled policy causes NotAllowedError; see the MDN display-capture policy reference.
Rank #2
- [Enhanced 4K-1080P Video Capture Experience] Capture the Magic: Elevate your video recordings to new heights with our upgraded anti-static 1080P Video Capture Card. Immerse yourself in stunning visuals, supporting HDMI input at 4K 60FPS and USB output for capturing in 1080P, complete with rich stereo sound. Enjoy crystal-clear video recordings, dynamic gaming live streams, and professional conference broadcasts. Note: HDMI resolution: Max input can be 3840×2160@30Hz / Video output resolution: Max output can be 1920×1080@30Hz
- [Seamless Real-Time Preview] Stay in the Moment: Our advanced ultra-low latency technology ensures seamless real-time transmission of video streams. Experience instant, lag-free previews, allowing you to capture every detail precisely. Effortlessly record video directly to your hard disk, all without compromising on quality or introducing any delays.
- [Versatility and Broad Compatibility] Your Creative Hub: Connect your DSLR, camcorder, or action camera to a wide range of operating systems, including Windows, MacOS, and Linux. Unlock a world of possibilities with real-time streaming to popular platforms like Twitch, Youtube, OBS, Zoom, Potplayer, and VLC, giving you the tools to share your content effortlessly.
- [Effortless Plug and Play] Simplicity Redefined: Say goodbye to complex installations. Our plug-and-play design eliminates the need for drivers or external power supplies. Seamlessly integrate high-definition acquisition into various scenarios, whether it's educational recordings, immersive gaming, precise medical imaging, captivating live streams, or professional broadcasting.
- [Seize Every Detail with Precision] Unleash your creativity and attention to detail with our video capture card. Capture every nuance, every color, and every moment with precision, thanks to the enhanced capabilities of our technology. Whether you're a content creator, a gamer, or a professional, our capture card empowers you to seize the finest elements and bring them to life in your recordings and live streams.
Choosing video and audio
Video is the share surface
Use video: true to request display video. The picker may offer a tab, window, or monitor, depending on the browser and operating system. Do not describe those choices as universally available.
Audio is conditional
You can request audio with audio: true, but that is not a guarantee that audio will be captured. Support depends on the browser, operating system, selected surface, and current implementation. Keep the audio choice visible in your UI and explain whether tab or system audio is expected.
const stream = await navigator.mediaDevices.getDisplayMedia({
video: true,
audio: true
});
const audioTracks = stream.getAudioTracks();
if (audioTracks.length === 0) {
// Tell the user that this browser or selected surface supplied no audio.
}
Review the MDN getDisplayMedia documentation and the MDN Screen Capture usage guide for current browser-specific audio notes.
Why constraints cannot select a source
Display capture is intentionally user-controlled. The W3C requirement says the user agent must let the end user choose from available display surfaces every time and must not use MediaTrackConstraints in options.video or options.audio to limit that choice. In practice, constraints can influence the resulting track after selection, but they cannot silently force “this monitor” or suppress the picker.
For example, this asks for a preferred frame rate after the user chooses a source; it does not select the source:
Rank #3
- 【4K HDMI Input, 2K@30Hz Recording】Powered by a true USB 3.0 high-speed interface, the capture card supports up to 4K@30Hz HDMI input and records at 2K@30Hz or 1080P@60Hz. Perfect for gamers, streamers, and professionals who need crisp, smooth video for live streaming, gameplay recording, or online meetings.
- 【Ultra Low Latency Screen Sharing】Built with a premium aluminum alloy shell and advanced chipset for stable heat dissipation, ensuring ultra-low latency transmission. Capture high-quality video and dual-channel audio in real time—no lag, no frame drop—ideal for Twitch, YouTube, or OBS streaming.
- 【Easy Plug and Play, Compact & Portable】No driver or external power required—just plug and play via USB 3.0 or Type-C connection to your Windows or macOS computer. Lightweight and compact design makes it easy to carry for outdoor streaming, live shows, or mobile recording setups.
- 【Wide Compatibility & Multi-Device Support】Compatible with Windows 7 8 10 11, macOS, Linux,Android and supports most popular software such as OBS, Zoom, VLC, Twitch Studio, and more. Works seamlessly with PS4, PS5, Xbox, Switch, DSLR cameras, TV boxes, and other HDMI-output devices for streaming to YouTube, Twitch, etc.
- 【What You Get】Includes: HDMI Capture Card, USB 3.0 to USB-C Adapter, User Manual. Tips: Make sure your tablet’s OTG function is enabled before connecting. Test your HDMI device with a monitor first to confirm video and audio output, then connect to the Video Capture Card for recording.
const stream = await navigator.mediaDevices.getDisplayMedia({
video: { frameRate: { ideal: 30, max: 60 } },
audio: false
});
Sending the capture through WebRTC
- Call
getDisplayMedia()in the click handler. - Set a local preview with
video.srcObject = streamso the sharer can see what is live. - Add each track to your existing
RTCPeerConnectionwithpeer.addTrack(track, stream). - Create or renegotiate an offer, send it through your signaling channel, and apply the remote answer.
- On the receiving peer, render the incoming stream in a separate video element.
- Listen for the capture track’s
endedevent. The user can stop sharing from browser chrome even when your page does nothing.
If you are replacing a camera track rather than adding a second video, use the connection’s sender and RTCRtpSender.replaceTrack() in your application logic. Stop old tracks when they are no longer needed.
Privacy and consent design
- Show a persistent “sharing” state and identify whether the app is sending a tab, window, or entire display.
- Provide an obvious stop button, while also handling the browser’s own stop control.
- Warn users that notifications, passwords, private documents, and other windows visible on the selected display may be exposed.
- Explain audio separately; users may expect video sharing without sound.
- Do not imply that cross-origin content is automatically safe. Captured browser content can reveal information protected by cross-origin restrictions.
The MDN Screen Capture API overview and the W3C security guidance describe these disclosure risks. Elevated permissions discussed by the specification are implementation advice, not a universal application-controlled switch.
Browser support and deployment decisions
MDN labels getDisplayMedia() “Limited availability” and not Baseline because it does not work in some widely used browsers. There is no single guarantee that every browser exposes the same source types, controls, or audio behavior. Check the current compatibility table for every browser and version you support, then test:
| Decision | What to verify |
|---|---|
| Surface | Whether tab, window, and full-display choices appear in the target browser and operating system. |
| Audio | Whether the selected surface can provide audio and how the browser labels consent. |
| Policy | Whether headers and iframe permissions allow display-capture. |
| UX | How users stop sharing and how your app detects the ended track. |
Common errors and fixes
NotAllowedError
The user may have cancelled, the call may not have followed a user gesture, the context may be insecure, or Permissions Policy may block the document. Use HTTPS, call from a visible click handler, inspect response headers and iframe attributes, and tell the user exactly what was cancelled.
TypeError or an unavailable API
Check that the options are valid, that the page is secure, and that the target browser implements the API. Feature-detect before rendering the share control:
Rank #4
- 【1080P HD High Quality】Capture resolution up to 1080p for video source and it is ideal for all HDMI devices such as PS4, PS3, Xbox One, Xbox 360, Wii U, DVDs, DSLR, Camera, Security Camera and set top box. Note: Video input supports 4K30/60Hz and 1080p120/144Hz. Does not support 4K120Hz/144Hz. Output supports up to 2K30Hz.
- 【Plug and Play】No driver or external power supply required, true PnP. Once plugged in, the device is identified automatically as a webcam. Detect input and adjust output automatically. Won't occupy CPU, optional audio capture. No freeze with correct setting.
- 【Compatible with Multiple Systems】suitable for Windows and Mac OS. High speed USB 3.0 technology and superior low latency technology makes it easier for you to transmit live streaming to Twitch, Youtube, Facebook, Twitter, OBS, Potplayer and VLC.
- 【HDMI LOOP-OUT】Based on the high-speed USB 3.0 technology, it can capture one single channel HD HDMI video signal. There is no delay when you are playing game live.
- 【Support Mic-in for Commentary】Rybozen capture card has microphone input and you can use it to add external commentary when playing a game. Please note: it only accepts 3.5mm TRS standard microphone headset.
const canShareDisplay = !!navigator.mediaDevices?.getDisplayMedia;
shareButton.hidden = !canShareDisplay;
Video works but audio is missing
The browser or selected surface may not support audio capture, or the user may have declined it. Inspect stream.getAudioTracks(), explain the limitation, and offer a browser-specific fallback such as sharing a tab when that is supported.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →The remote video freezes when the user stops
Stopping a display track ends the source. Handle track.onended, notify the peer, and remove or replace the sender in your call state instead of assuming the stream remains reusable.
An iframe cannot start capture
Confirm the top-level Permissions Policy, the iframe’s allow="display-capture", and the origin listed by the header. Policy access does not bypass the picker.
Performance and reliability considerations
Full-display video can produce substantial bandwidth and CPU use. Negotiate an appropriate resolution and frame rate after selection, avoid showing unnecessary duplicate previews, and monitor outbound WebRTC statistics in your existing call diagnostics. Keep the UI responsive while waiting for the picker; the user may take time to choose.
Design for cancellation and intermittent support rather than retrying automatically. A fresh call should produce a fresh user choice. For recordings, retain the same ended-track handling and close the recorder when all relevant tracks stop.
Best Value
- AV TO USB Converter: Capture videos and audios from VHS, VCR, Hi8, DV tapes to a PC, with the help of our USB Video Converter. Save room while digitizing your favorite old memories
- Quality Capture Card: Our USB Video Capture Card converting anolog RCA composite input into HD 720P USB output and capturing audio without any sound card. Advanced signal processing technology provides you with great precision, colors, resolutions, and details.
- Plug and Play: Automatically install the driver once you hook up this RCA to USB Converter to a PC. No external power is needed. User-friendly and easy to operate
- Wide Compatibility: The Video Capture Card can work with video devices with RCA connector or S-Video connector, such as VHS, VCR, Hi8, camcorder, compatible with Windows and Mac OS. Support video formats like NTSC, PAL, and support brightness, contrast, hue, and saturation control
- Note: The Video Converter is used with acquisition software. We recommend OBS Studio or PotPlayer for Windows, and QuickTime Player for Mac. They can be downloaded for free online. Please operate according to the steps in User Manual or contact us if you have any questions
Or skip the browser setup
If your goal is a static website image rather than an interactive user-approved screen share, ScreenshotNeo is a simpler API. It renders a URL on its service and returns PNG, JPEG, WebP, or PDF; it does not capture a visitor’s private monitor.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo documentation for all options. Cookie banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers identify the page verdict and billing result. Its MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
Further reading
- W3C Screen Capture Working Draft
- MDN MediaDevices.getDisplayMedia()
- MDN display-capture Permissions Policy
- MDN Screen Capture API
- MDN Using the Screen Capture API
Frequently Asked Questions
Can a website capture my screen without asking?
No. The browser must let you choose a display surface each time; a page cannot silently select or persist a display-capture permission.
Does getDisplayMedia() work from an HTTP page?
Use a secure context, normally HTTPS. Test localhost separately during development because browser trust rules can differ.
Recommended Free Tools
Can I capture only one application automatically?
No. Your code cannot use constraints to narrow the picker. The user chooses the available tab, window, or display.
Why does the browser show a picker on every call?
The Screen Capture rules require a fresh end-user choice for each capture request, rather than a permanent grant.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

