7

There have been some buzz in the air for the WebRTC support in Firefox 22. This is for someone who's in the know about Firefox development: Are there any support in Firefox for desktop screen capture todate?

The technology does exist for Chrome 26+, which provides experimental support for screen capturing (using 'screen' as device source); the code (snippet) for making this happen is:

   // select any supported getUserMedia function
   navigator.getMedia = (navigator.getUserMedia || 
                         navigator.webkitGetUserMedia ||
                         navigator.mozGetUserMedia ||
                         navigator.msGetUserMedia);

  // if getUserMedia is not supported, do nothing 
  if( !navigator.getMedia ) return;

  // request for user media
  navigator.getMedia(
  {
     video : {
        mandatory : {
           // request 'screen' as a source media
           chromeMediaSource : 'screen'
        }
     }
  },

  // success
  function( localMediaStream )
  {
     // process local media stream...
  },

  // failure
  function( error )
  {
     // error handling
  });

Looking at W3C docs, the objects MediaSourceConstraints, MediaTrackConstraints, MediaTrackConstraintsSet have not yet been standardized. It might simply be that the API is all too foggy for this feature to appear in Firefox production. It would just be good to know the current state of support.

4

2 回答 2

4

不,Firefox 还没有像 Chrome 那样添加屏幕共享:https ://bugzilla.mozilla.org/show_bug.cgi?id=742832

于 2013-06-27T19:54:32.730 回答
4

现在这在 Firefox 中是可能的,但是出于安全考虑,支持隐藏在某些首选项后面。具体media.getusermedia.*下的偏好about:config

对 Mozilla 错误报告的评论说明了其中一些担忧:

现在我们已经重新设计<input type="file">为不在屏幕上绘制完整路径,事情变得更好了。我们在绘制跨域图像和<iframe>s 等问题上仍然存在问题。

即使用户选择加入,我也会担心“用户在一个选项卡中加载应用程序页面 A,在另一个选项卡中加载应用程序页面 B,页面 B 请求屏幕共享页面 A 的权限,看起来不错,用户接受,然后应用程序将<iframe>FB 或 gmail 或其他任何内容交换到页面 A 并获取内容。

虽然media.getusermedia.screensharing.enabled目前true默认情况下在发布通道中,但media.getusermedia.screensharing.allowed_domains实际上只有那些列入白名单的域才被允许使用它。

如果您的域在允许列表中,您可以使用video属性中的以下键来使用它。

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

Mozilla在 Firefox Nightly 和 Firefox Developer Edition 列入白名单的域上托管一个getUserMedia 测试页。如果您使用这些版本的 Firefox 中的任何一个,您都可以看到它的实际效果。或者,您可以将域添加到下面的白名单中,about:config并在发布和测试渠道中使用它。

于 2016-02-09T00:46:16.767 回答