Bug 262952 - [Macos, ios, ipados] Webrtc new audio on an inactive tab not playing
Summary: [Macos, ios, ipados] Webrtc new audio on an inactive tab not playing
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 17
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-10-10 04:55 PDT by ivan.zahrodskyi
Modified: 2023-10-17 22:20 PDT (History)
3 users (show)

See Also:


Attachments
sample to try this problem (2.15 KB, text/html)
2023-10-10 04:55 PDT, ivan.zahrodskyi
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description ivan.zahrodskyi 2023-10-10 04:55:10 PDT
Created attachment 468147 [details]
sample to try this problem

We noticed problem with audio during webrtc call on inactive tab.

Situation:
- User is in the webrtc active call from safari. But this user is doing something on another tab (e.q. shares that tab, reads some information or whatever)
- another user joins that call, so new audio track is received but there no any way to play that track (because tab is inactive)

I created little sample to reproduce this.
- open example
- press start
- open another tab and wait (near 10 seconds)
result:
- no audio

this works fine in chrome but not in safari.

Issue is valid for macos and ios.

I'm wondering is it some kind of safari limitation? or this is a bug?
Comment 1 Radar WebKit Bug Importer 2023-10-10 05:08:05 PDT
<rdar://problem/116733429>
Comment 2 youenn fablet 2023-10-10 05:09:28 PDT
This might be an autoplay issue.
To remove the autoplay restriction, you might want to call play() as part of a user gesture. Or if user is capturing.

What happens in your example if the JS is calling play() when the start button is triggered?
Comment 3 ivan.zahrodskyi 2023-10-10 05:24:44 PDT
(In reply to youenn fablet from comment #2)
> This might be an autoplay issue.
> To remove the autoplay restriction, you might want to call play() as part of
> a user gesture. Or if user is capturing.
> 
> What happens in your example if the JS is calling play() when the start
> button is triggered?

still no audio.

But anyway in real world scenario where many participants joins a call we a creating video/audio elements dynamically, so how I can remove autoplay restriction in that case.

Also I tried to set "Allow All Auto-Play" in safari settings and it doesn't helped.