Skip to content

Commit

Permalink
Mention cursor constraint explicitly.
Browse files Browse the repository at this point in the history
An example is also added in screen-share#18

fixes screen-share#15
  • Loading branch information
fred-wang committed Jun 27, 2023
1 parent bfb1cf0 commit a9b0256
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Screen-Capture Mouse Events

Web applications can use `getDisplayMedia()` to capture any display-surface - tabs, windows or screens.
When they do, they can also specify the cursor constraint to control whether the cursor's pixels are captured or not.
When they do, they can also specify the [cursor constraint](https://www.w3.org/TR/screen-capture/#dfn-cursor) to control whether the cursor's pixels are captured or not.

But what if the application wishes to programmatically observe the location of the cursor?
That can be done by scanning each frame and employing heuristics to detect the cursor.
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ <h3>Use case #2: Efficiency enhancements during RTC</h3>
is per-frame IPC overhead which multiplies with the max framerate.
</p>
<p>
The <a data-cite="screen-capture/#dfn-cursor">cursor constraint</a>
can be used to omit the cursor from the captured frames.
If mouse coordinates were known to the encoding application, it could transmit these
coordinates to the receiving application (on another device). The receiver could then
redraw a cursor on the other side. (Note that, depending on the decoder, this is likely
Expand Down

0 comments on commit a9b0256

Please sign in to comment.