-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposing cursor image (SVG/PNG/...) and dimensions (width, height) #4
Comments
Why not follow the current CSS way of doing it with a string? E.g. But that string can also be a URL, e.g. |
Maybe.
|
An partial interface CaptureController {
ImageBitmap getCursor(long cursorId);
}; |
i like the cursor idea. and it is needed for on-line meeting case, which need to transmits to the remote. |
In another thread, @fideltian seemed to suggest exposing the cursor shape directly on the events, but only for the first event following a change of cursor.
|
Hi Elad, I just read the spec(https://screen-share.github.io/mouse-events/) before and i did not notice the #4. i think your original proposal is also great. App just compare the cursorId for the change, correct? if changes, use the query API to get the picture of cursor. If that, i like it. |
Thanks, I love your proposal too! :-) Maybe we can synthesize them to get an API that has the best of all worlds: partial interface CapturedMouseEvent {
readonly attribute boolean cursorShapChanged; // ...since last event.
ImageBitmap getCursorShape();
}; This way:
|
I can see there are more proposals already discussed in this thread. I would like to share my idea of having access to currently displayed cursor, which is rather simple: having CapturedMouseEvent with a parameter having one of these values https://developer.mozilla.org/en-US/docs/Web/CSS/cursor i.e My use case / idea would be, to avoid replacing system cursor (on system), and rather "hide" it from capturing |
I believe that's what @ldenoue proposed in the second comment on this thread. Afaict, this solution would not scale - it won't work for custom cursors, and even with the standard CSS ones, it won't work correctly between one user on (Chrome, Mac) and another one on (Firefox, Windows). I think a more ideal solution would be to expose a bitmap or vector-graphic. |
Many of the potential use-cases of this API consist of suppressing the "traditional" capture of the cursor in the video frames, so that it could be redrawn later, other faithfully or after some enhancing modification. Often, this would require a way to discover the original look and size of the cursor. It seems that it would be useful to align on a way to expose those.
Examining for the time being exposure of the image, but not the dimensions...
One way would be to expose some image of the cursor on each CapturedMouseEvent. That seems a bit wasteful, though. For the user agent, this might require some avoidable work with each event. For the Web app, checking whether the cursor changed between two subsequent events, might be less efficient than it could be.
Another way might be to expose a cursor-ID, which could simply be a
long
, and then introduce a separate API surface which would allow an interested app to query the user agent for the actual image of cursor. An example might be:(I'm using SVG as an example. It might very well be that we prefer a different format.)
The text was updated successfully, but these errors were encountered: