Is it possible to embed two webcam streams on one Html page from one or more cameras.

ⅰ亾dé卋堺 提交于 2019-12-06 06:24:44
jib

You tell a video element which stream to play by setting its src property.

Basically you need to duplicate all the code supporting videoElement here, not just its creation.

One problem you'll run into is that many browsers frown on calling getUserMedia twice at the same time (before the previous asynchronous call has completed), because this overwhelms users with multiple prompts at once. To work around this, put the second call to getUserMedia inside handleVideo, to only bother the user with one prompt at a time.

The third problem you'll run into, is that only Firefox has built-in device selection in the permission prompt, so on Chrome you'll get the same camera twice.

To make this work on other browsers you'll need enumerateDevices. I've answered that before.

Lastly, most smart phones are hardware limited and can't run both cameras at once.

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