[英]Is there a way to set default capture device in Chrome like navigator.setUserMedia()? (GOOGLE CHROME)
I am currently trying to switch the input video source being displayed but from what I have found, navigator.getUserMedia() can be used to get the localMediaStream but it only has a handle on one of each audio and video sources available to the browser. 我目前正在尝试切换显示的输入视频源,但是从我发现的结果来看,可以使用navigator.getUserMedia()来获取localMediaStream,但它仅对浏览器可用的每个音频和视频源之一都有一个句柄。
Is there a way (using html or javascript) to set the default camera in Chrome if I have the device IDs? 如果我具有设备ID,是否可以使用Chrome或javascript设置默认摄像头的方法?
Check this demo: https://webrtc.github.io/samples/src/content/getusermedia/source/ 检查此演示: https : //webrtc.github.io/samples/src/content/getusermedia/source/
Basically, you use MediaStreamTrack.getSources, pass the sourceId optional constraint to getUserMedia and you're good. 基本上,您使用MediaStreamTrack.getSources,将sourceId可选约束传递给getUserMedia,您就很好。 You can store the device ids, they stay the same until the cookies are cleared.
您可以存储设备ID,直到清除cookie为止,它们保持不变。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.