如何让 iOS 有 2 个视频流?

How can I get iOS to have 2 video streams?

现在,如果我使用我的 iPhone 或 iPad 并尝试显示两个流,一个是黑色的,另一个有效。我该怎么做才能让两者都工作?这适用于我笔记本电脑上的所有浏览器。

<script>
 navigator.mediaDevices.getUserMedia({ audio: true, video: true})
      .then(function(camera) { document.getElementById("video1").srcObject = camera;})
      .catch(function(error) { console.error("ERROR", error) });

 navigator.mediaDevices.getUserMedia({audio: true, video: { width: 400, height: 200}})
      .then(function(remote_camera) { document.getElementById("video2").srcObject =  remote_camera;})
      .catch(function(error) { console.error("ERROR", error) });

</script>

<video id="video1" controls autoplay playsinline></video>
<video id="video2" controls autoplay playsinline></video>

iOS 上的 Safari 一次不支持多个活动相机。

https://bugs.webkit.org/show_bug.cgi?id=238492 is the most recent bug report about it but this behavior has been documented back in 2018 already: https://webrtchacks.com/guide-to-safari-webrtc/