<?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>285391</bug_id>
          
          <creation_ts>2025-01-04 16:27:04 -0800</creation_ts>
          <short_desc>HTML audio element currentTime property too high when setting srcObject to MediaStream (macOS and iOS)</short_desc>
          <delta_ts>2025-01-07 04:59:15 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>Safari 18</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 15</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>vladik.mashk</reporter>
          <assigned_to name="youenn fablet">youennf</assigned_to>
          <cc>jer.noble</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2084884</commentid>
    <comment_count>0</comment_count>
    <who name="">vladik.mashk</who>
    <bug_when>2025-01-04 16:27:04 -0800</bug_when>
    <thetext>I am developing a website with VoIP. I am setting the srcObj property of an audio element with the MediaStream of the user at the other end of the line (using PeerJS). I am also showing the time since the start of the call by displaying the currentTime property of the audio element every second.

This works fine on windows chrome and firefox, but on webkit browsers (macOS AND iOS), the currentTime property is way too high. Like it is equal to several hours when the call has just started.

Example:
https://jsfiddle.net/vladmashk/j3ysLf29/1/

&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;/&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;audio id=&quot;audioElement&quot; autoplay&gt;&lt;/audio&gt;
&lt;div&gt;Time passed: &lt;span id=&quot;timePassed&quot;&gt;&lt;/span&gt;&lt;/div&gt;

&lt;script type=&quot;module&quot;&gt;
    const audioElement = document.getElementById(&quot;audioElement&quot;);
    const stream = await navigator.mediaDevices.getUserMedia({audio: true});
    audioElement.srcObject = stream;

    setInterval(() =&gt; {
        document.getElementById(&quot;timePassed&quot;).innerText = audioElement.currentTime;
    }, 1000)
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2085356</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-01-07 01:44:03 -0800</bug_when>
    <thetext>&lt;rdar://problem/142465970&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2085357</commentid>
    <comment_count>2</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2025-01-07 01:48:37 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/38633</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2085383</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-01-07 04:59:13 -0800</bug_when>
    <thetext>Committed 288519@main (8194ca4f8b6f): &lt;https://commits.webkit.org/288519@main&gt;

Reviewed commits have been landed. Closing PR #38633 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>