If you are running your web application inside an iframe, you will receive the following error message when trying to perform screen-share:
Failed to execute 'getDisplayMedia' on 'MediaDevices': Access to the feature 'display-capture' is disallowed by permission policy
This happens due to a permission policy that was added to all major browsers which explicitly prevents screen share from an application running inside an iframe. Further details about the policy is available at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy.
Do not use an iframe.