简体   繁体   English

有没有办法在Chrome中设置默认的捕获设备,例如navigator.setUserMedia()? (谷歌浏览器)

[英]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.

相关问题 有没有办法让 Chrome “忘记”一个设备来测试 navigator.usb.requestDevice, navigator.serial.requestPort? - Is there a way to get Chrome to “forget” a device to test navigator.usb.requestDevice, navigator.serial.requestPort? 谷歌浏览器导航器在线始终为真 - google chrome navigator onLine always true 捕获Google Chrome浏览器网络套接字活动 - Capture Google Chrome websockets activity 是否可以在Google Chrome中更改navigator.appname? - Is it possible to change navigator.appname in google chrome? navigator.webkit电池在Google Chrome中不起作用 - navigator.webkitBattery not working in Google chrome 如何在Google Chrome浏览器中为SpeechSynthesisUtterance设置默认语音? - How do I set the default voice for SpeechSynthesisUtterance in Google Chrome? Google Chrome chrome.usb / chrome.hid已锁定设备 - Google Chrome chrome.usb / chrome.hid locked device 直到在Chrome设备模式下拖动结束,Google Maps拖动事件才会捕获中心更改 - Google Maps drag event doesn't capture center change until dragging ends in Chrome Device Mode 将Google Chrome屏幕截图集成到网站/ html - Integrate Google Chrome screen capture into website/html 有没有办法将导航器设置为键入区域默认值 - Is there any way to set the Navigator to type area default
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM