Firefox 22 mozGetUserMedia using 'screen' as device source

三世轮回 提交于 2019-12-04 04:38:31

This is now possible in Firefox, however due to security concerns, support is hidden behind some preferences. Specifically the media.getusermedia.* preferences under about:config.

This comment on a Mozilla bug report illustrates some of those concerns:

Now that we've redesigned <input type="file"> to not draw the full path on the screen, things are better. We still have problems with things like drawing cross-origin images and <iframe>s.

Even with user opt-in, I'd worry about situations like "user loads app page A in one tab and app page B in another tab, page B asks for permission to screen-share page A which looks fine, user accepts, then app swaps an <iframe> of FB or gmail or whatever into page A and grabs the contents.

Though media.getusermedia.screensharing.enabled is currently true by default in the release channel, only those domains whitelisted under media.getusermedia.screensharing.allowed_domains are actually allowed to use it.

If your domain is on the allowed list, you can use it by using the following keys in the video property.

video: {
    mozMediaSource: "screen",
    mediaSource: "screen"
}

Mozilla hosts a getUserMedia Test Page, on a domain that is white-listed by Firefox Nightly and Firefox Developer Edition. If you use either of these versions of Firefox, you can see it in action. Alternately you could add the domain to the whitelist under about:config and use it in the release and beta channels.

No, Firefox hasn't yet added screensharing like Chrome: https://bugzilla.mozilla.org/show_bug.cgi?id=742832

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!