Bug 259488 - Cannot use camera/microphone device in multiple windows/tabs simultaneously
Summary: Cannot use camera/microphone device in multiple windows/tabs simultaneously
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 16
Hardware: Mac (Apple Silicon) macOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-07-25 10:42 PDT by btham
Modified: 2023-08-01 10:43 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description btham 2023-07-25 10:42:08 PDT
I'm working on test automation for our web app, which does a WebRTC call between two windows/tabs. For example, a simple test might involve one Safari window/tab starting a WebRTC call with a microphone/camera, another window/tab joining the call with a microphone/camera, and checking that audio and video are being sent and received. For test purposes, we are using the mock capture devices setting in Safari, but this issue also affects real capture devices.

When the second Safari window/tab starts their microphone/camera, the microphone from the first window/tab stops sending audio, and the camera from the first window/tab becomes black. My guess is that this is some privacy/security mechanism kicking in, but it does make it impossible to test WebRTC calls between 2 Safari windows/tabs.

This can be reproduced with this simple WebRTC sample: https://webrtc.github.io/samples/src/content/devices/input-output/. Simply open this link in 2 separate Safari windows/tabs.

This used to not be an issue as long as I opened them in separate windows (opening them in separate tabs, as far as I know, has always exhibited this behavior). This was about a year ago (sorry, I don't have the specific Safari version for you, but I assume it was macOS 12 and Safari 15). Now both opening in separate windows and opening in separate tabs exhibits this behavior. So I'm unsure if this is a regression; I couldn't find anything in the Safari patch notes about it.

If this is expected behavior, are there any ways to get around this limitation?
Comment 1 Radar WebKit Bug Importer 2023-08-01 10:43:14 PDT
<rdar://problem/113215254>