Open Bug 1724865 Opened 3 years ago Updated 2 months ago

InvalidStateError: "getDisplayMedia must be called from a user gesture handler" in cross-origin iframe with allow="camera; microphone; display-capture"

Categories

(Core :: WebRTC: Audio/Video, enhancement, P3)

Firefox 87
enhancement

Tracking

()

People

(Reporter: karlt, Unassigned)

References

(Depends on 1 open bug, )

Details

+++ This bug was initially created as a clone of Bug #1704278 +++
The back-out for bug 1704278 did not actually resolve the reported issue because it was not actually a regression. This tracks finding a solution.

Discussion on https://github.com/w3c/mediacapture-screen-share/issues/167 is leaning towards a more general solution, but top-level transient activation may still be worth considering as an interim option.

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0

Steps to reproduce:

This will happen when api.executeCommand('toggleShareScreen'); is called in Jitsi meet IFrame API (https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-iframe#togglesharescreen). The IFrame Jitsi is using has allow="camera; microphone; display-capture; autoplay; clipboard-write" set.
The API call is triggered during a click event.
Clicking inside the IFrame first and then calling the API does work.
Internally obtainScreenFromGetDisplayMedia is called (cf. https://github.com/jitsi/lib-jitsi-meet/blob/2a2405e93614efd43d4db62f51399f5a870a1615/modules/RTC/ScreenObtainer.js)

Actual results:

InvalidStateError: "getDisplayMedia must be called from a user gesture handler"

Expected results:

Call to getDisplayMedia is allowed because call is made following a click event and the iframe is using allow="display-capture".

STR:

  1. Click the User gesture button in https://jsfiddle.net/jib1/0L3eujzq/ without clicking in the iframe first.

Resolution of bug 1830200 may mean that this can be resolved WONTFIX

Depends on: 1830200
You need to log in before you can comment on or make changes to this bug.