One comment on “Using getDisplayMedia for local recording with audio on Jitsi

  1. Jan-Ivar over at Mozilla had a number of great comments I will review and address in an update. Here they are for readers who see this before I make that update:

    Under “iFrame Permissions” you say “Safari requires iframe allow="display"

    but for me, Safari 13.1 on macOS seems to support “display-capture” which btw is to spec.
    (Safari on iOS is another matter; no support even on ipads.)

    “API includes a displaySurface option for choosing between desktop … displaySurface selection constraints are useless … essentially the constraints are allowed to do anything”

    Yes, they’re read-only effectively, and were almost removed to avoid confusion. However, they do let JS know what category of surface the user chose, using track.getSettings(), so not 100% useless even though perhaps it’s close 😉.

    “Firefox and Safari require a user gesture”

    “Firefox, Safari, and the spec require a user gesture” — might be helpful to readers as to what changes to expect here 😉

    “there are differences in the information returned by each track”

    FWIW constraints are source-specific, and there’s an explicit list in the screen-capture spec of the only constraints that should work there. E.g. I believe all of the audio constraints you mention as specific to microphones, so I wouldn’t expect them to stick around in Chrome.

    “Inconsistent constraint checks … Audio only requests are not supported”

    True, though the error is a Chrome bug. In Firefox (even though it doesn’t support audio yet) as well as the spec, {video} defaults to true in this spec, which means calling navigator.mediaDevices.getDisplayMedia() without arguments should get you video, and {audio: true} = {video: true, audio: true}.

    I also wanted to mention the “limitations” are intentional and not likely to be lifted: sharing a web surface exposes users to unique security attacks that are hard to explain even to experts (circumventing the same-origin policy). See this blog for details.

    Oh and thanks for covering the macOS permission stuff. FWIW on the “Unfortunately this setting only takes effect after you reset the application” it seems to work for me even when I don’t, but YMMV.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.