iPhone continuity camera not displaying in Web API on Safari

687 Views Asked by At

iPhone continuity camera not displaying in MediaDevices enumerateDevices()

I'm using the simple code to enumerate media devices on Safari

navigator.mediaDevices.getUserMedia({ audio: true, video: true })
  .then(stream => {
    if (!navigator.mediaDevices?.enumerateDevices) {
      console.log("enumerateDevices() not supported.");
    } else {
      // List cameras and microphones.
      navigator.mediaDevices.enumerateDevices()
        .then((devices) => {
          devices.forEach((device) => {
            console.log(`${device.kind}: ${device.label} id = ${device.deviceId}`);
          });
        })
        .catch((err) => {
          console.error(`${err.name}: ${err.message}`);
        });
    }
  })
.catch(err => console.error("queryMediaDevices:Error", err));

But I'm just getting the iPhone mic and not the camera. But when I enter another web app, or go to google meets, I can select the phone's camera and use it.

Currently on macOS 13.0, and iOS 16.2.

Is there anything I'm missing?

2

There are 2 best solutions below

0
On

The issue was caused solved by updating macOS to 13.1 and safari to 16.2. Now it's working just fine.

0
On

There's a "magic pose" your camera needs to be in for browsers to detect your continuity camera:

Due to privacy concern with unintended camera selection, browser based video apps only see the phone when it is in "magic pose" of landscape, screen off, locked, motionless (not handheld), and unobstructed camera. This pose is also used to trigger Automatic Camera Selection in supporting applications such as FaceTime and Photo Booth.