<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>262952</bug_id>
          
          <creation_ts>2023-10-10 04:55:10 -0700</creation_ts>
          <short_desc>[Macos, ios, ipados] Webrtc new audio on an inactive tab not playing</short_desc>
          <delta_ts>2023-10-17 22:20:24 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebRTC</component>
          <version>Safari 17</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>ivan.zahrodskyi</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>Kongpheng.Nanthavongsa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1983966</commentid>
    <comment_count>0</comment_count>
      <attachid>468147</attachid>
    <who name="">ivan.zahrodskyi</who>
    <bug_when>2023-10-10 04:55:10 -0700</bug_when>
    <thetext>Created attachment 468147
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&apos;m wondering is it some kind of safari limitation? or this is a bug?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983970</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-10-10 05:08:05 -0700</bug_when>
    <thetext>&lt;rdar://problem/116733429&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983971</commentid>
    <comment_count>2</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2023-10-10 05:09:28 -0700</bug_when>
    <thetext>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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983974</commentid>
    <comment_count>3</comment_count>
    <who name="">ivan.zahrodskyi</who>
    <bug_when>2023-10-10 05:24:44 -0700</bug_when>
    <thetext>(In reply to youenn fablet from comment #2)
&gt; This might be an autoplay issue.
&gt; To remove the autoplay restriction, you might want to call play() as part of
&gt; a user gesture. Or if user is capturing.
&gt; 
&gt; What happens in your example if the JS is calling play() when the start
&gt; 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 &quot;Allow All Auto-Play&quot; in safari settings and it doesn&apos;t helped.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>468147</attachid>
            <date>2023-10-10 04:55:10 -0700</date>
            <delta_ts>2023-10-10 04:55:10 -0700</delta_ts>
            <desc>sample to try this problem</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>2200</size>
            <attacher>ivan.zahrodskyi</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KPGhlYWQ+CiAgPG1ldGEgY2hhcnNldD0i
VVRGLTgiPgogIDx0aXRsZT5UaXRsZTwvdGl0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