<?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>271313</bug_id>
          
          <creation_ts>2024-03-20 06:36:58 -0700</creation_ts>
          <short_desc>disconnecting bluetooth device rendered in DOM breaks video track</short_desc>
          <delta_ts>2024-08-05 21:55:44 -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>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 14</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>270522</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Pontus Fagerström">pontus.fagerstrom</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2022448</commentid>
    <comment_count>0</comment_count>
    <who name="Pontus Fagerström">pontus.fagerstrom</who>
    <bug_when>2024-03-20 06:36:58 -0700</bug_when>
    <thetext>When a bluetooth device, being rendered in DOM in an HTMLAudioElement, is removed it breaks video track, obtained from navigator.mediaDevices.getUserMedia().

Reproduce like this:
1. https://webrtc.github.io/samples/src/content/devices/input-output/
2. Use bluetooth microphone (I tested with AirPods A2031 and Sennheiser Momentum 3, version 96.8.3)
3. Make the device disconnect from the computer (I put the Airpods back in the case / turned off the Sennheiser Momentum 3 headphones)
4. See the video image freeze

When I reproduce locally in a small lab/experiment project the video tile turns black instead of freezing.
I&apos;ve tested using RTCPeerConnections and on the remote end the incoming video bitrate drops and the video tile turns black.

If you do the same thing with an audio device connected via USB the video is not affected.

If you don&apos;t render the audio in DOM the video is not affected when the bluetooth device is disconnected.

I render it like this:
1. create a HTMLAudioElement
2. create a MediaStream
3. add the audio track to the MediaStream
4. do audioElement.srcObject = stream</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2022454</commentid>
    <comment_count>1</comment_count>
    <who name="Pontus Fagerström">pontus.fagerstrom</who>
    <bug_when>2024-03-20 06:55:47 -0700</bug_when>
    <thetext>It does not seem to matter if the video and audio tracks were obtained in the same or in separate getUserMedia calls.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2023139</commentid>
    <comment_count>2</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2024-03-22 09:23:10 -0700</bug_when>
    <thetext>I believe this is fixed in bug 270522.
Please reopen otherwise.

*** This bug has been marked as a duplicate of bug 270522 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2050842</commentid>
    <comment_count>3</comment_count>
    <who name="Pontus Fagerström">pontus.fagerstrom</who>
    <bug_when>2024-08-05 21:55:44 -0700</bug_when>
    <thetext>I understand this might not be the best place to ask, but I&apos;m struggling to find documentation.

The issue seems to be fixed in Safari technology preview Release 200 (Safari 18, Webkit 19620.1.1) but not in recently released Safari 17.6 on Sonoma 14.6.

The PR that should fix it was merged in March https://github.com/WebKit/WebKit/pull/25487.

How do I learn when the PR that was merged is included in a specific Safari version?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>