The web platform already allows web applications to capture the current tab’s video track. It now ships with Region Capture, a mechanism for cropping these video tracks. The web application designates a portion of the current tab as its area of interest, and the browser crops all pixels outside that area.
The web application could previously crop video tracks “manually”. That is, the web application can directly manipulate each frame. This is neither robust nor efficient. Area capture addresses these shortcomings. A web application can now instruct the browser to do work on its behalf.
#About area capture
So, you have created a website using Dynamic Content™. This is the best web app ever, people use it collaboratively so often and can’t stop using it. The next step could be to embed virtual meeting capabilities. You decide to do so. You work with an existing videoconferencing service provider to embed their web application as a cross-domain iframe. The video conferencing web application captures the current tab as a video track and transmits it to remote participants.
The main content area is blue, and the cross-domain iframe is red.
Not so fast… you wouldn’t really want to send people their own videos back to them would you? It’s best to cut that part off. But how? Embedded iframes don’t know what you’ve exposed and where, so they can’t be cropped without help. In theory, you can pass the expected coordinates. But what happens if the user resizes the window? Scroll viewport? Zoom in or out? Interact with the page in a way that produces layout changes? Even if you send new coordinates to the capture iframe, timing issues can still cause some bad frames.
So let’s use area capture. You have an
Element on your page, probably a
<div> that contains the main content. Let’s call it
mainContentArea . You want the videoconferencing web application to capture and share the bounding box of this element remotely…
This article is reprinted from https://blog.p2hp.com/archives/9489
This site is for inclusion only, and the copyright belongs to the original author.