WebRTC Firefox 限制 [英] WebRTC firefox constraints

查看:32
本文介绍了WebRTC Firefox 限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在个人开发中使用 WebRTC,一切正常.我从网络摄像头获取流,但现在我想对 getUserMedia() 使用约束.

var 约束 = {音频:假,视频: {强制的 : {最小宽度:1280,最小高度:720}}};

当我在 Firefox 中测试时,它似乎忽略了这些限制.当我在 Chrome 或 Opera 上测试时,我的约束工作正常,质量也很好,有人知道为什么吗?问题是 Firefox?

感谢您的建议

解决方案

编辑 wiki 链接似乎已经过时,请参考 jib 的回答如下.

看起来 Firefox 尚未实施约束.><块引用>

自 Chrome 24 和 Opera 18 起已实施约束.这些可用于为 getUserMedia() 和 RTCPeerConnection addStream() 调用设置视频分辨率值.

来自:https://wiki.mozilla.org/Media/getUserMedia

<块引用>

[在 Firefox 中] 视频的捕获分辨率目前固定为 640x480;

只支持

<块引用>

支持的最小约束:(注意:所有这些布尔值默认为'false')视频:真/假音频:真/假假:真/假图片:真/假

I currently use WebRTC in my personal development, everything works fine. I get the stream from my webcam, but now I want to use constraints for getUserMedia().

var constraints = {
           audio: false,
           video: {
               mandatory : {
                     minWidth: 1280,
                     minHeight: 720 
               }
           }
};

When I test this in Firefox it seems to ignore the constraints. When I test on Chrome or Opera my constraints work fine and my quality is good, anyone know why? The problem is Firefox?

Thanks for you suggestions

解决方案

Edit the wiki link seems to be outdated, please refer to jib's answer down below.

It seems like Firefox has not yet implemented constraints.

Constraints have been implemented since Chrome 24 and Opera 18. These can be used to set values for video resolution for getUserMedia() and RTCPeerConnection addStream() calls.

and from: https://wiki.mozilla.org/Media/getUserMedia

Capture resolution [in Firefox] currently fixed to 640x480 for video;

It only supports

Minimal constraints supported: (Note: all of these booleans default to 'false') video: true/false audio: true/false fake: true/false picture: true/false

这篇关于WebRTC Firefox 限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆