Open thexeos opened 1 month ago
Wrt to 1, there is https://w3c.github.io/mediacapture-main/#context-is-capturing. The main difference is that it would return false in case there are live but muted tracks. This seems actually fine to me.
Wrt 2, privacy indicators are defined at https://w3c.github.io/mediacapture-main/#privacy-indicator-requirements. They stay on for a minimum of 3 seconds (meaning that a web application that calls getUserMedia and stops the tracks immediately would have its privacy indicator on for at least 3 seconds).
Privacy indicators are usually implemented per top-level browsing context, which might align with the idea to prompt when the top-level browsing context is getting closed and either itself or one of its child is/was capturing recently.
Feature request proposing a change to
beforeunload
firing behavior was filed in WHATWG repo: https://github.com/whatwg/html/issues/10627WHATWG proposal summary: current
beforeunload
would not show "Are you sure you want to close this page?" dialog unless user had clicked/typed inside the Document. However, Media Capture allowsgetUserMedia()
to succeed without such prior user activation. As a result, one could develop a web application that joins a conference call immediately upon page load, but afterwards can't prevent the user from accidentally closing the tab/window/PWA with an active call.To facilitate correct
beforeunload
prompt behavior, it is likely that Media Capture amendments will be necessary.The proposed WHATWG change would rely on detecting active Media Capture session. Furthermore, to prevent abusive
beforeunload
prompts a minimum Media Capture session duration should be considered (e.g., during first 15 seconds of "activationless" Media Capture, user can close the page without seeing thebeforeunload
prompt - note that the countdown must being from getUserMedia() resolving).Current Media Capture specs don't expose any standard ways to determine:
Those would likely have to be specified in order to define correct 'beforeunload' prompt behavior.
Ref: https://issues.chromium.org/issues/40704936#comment9