<?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>306350</bug_id>
          
          <creation_ts>2026-01-27 09:43:52 -0800</creation_ts>
          <short_desc>AX: Syncing currentTime of Audio and Video elements results in playback offset</short_desc>
          <delta_ts>2026-01-28 17:18:07 -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 26</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 15</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P1</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>sebastian.bayer</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andresg_22</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>jer.noble</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2175474</commentid>
    <comment_count>0</comment_count>
    <who name="">sebastian.bayer</who>
    <bug_when>2026-01-27 09:43:52 -0800</bug_when>
    <thetext>The accessibility (a11y) plugin for the JavaScript library &quot;MediaElement&quot; implements audio descriptions for videos. It does this by creating an additional &lt;audio&gt; element on the page and synchronizing its currentTime with the video during the video’s native &quot;timeupdate&quot; event. This approach works correctly in Chrome and Firefox, but in Safari it causes choppy or interrupted audio playback.

I know a WebVTT-based synthesized audio description would be a better solution, but OS support is disabled by default for this, see https://bugs.webkit.org/show_bug.cgi?id=266724 and support for this &lt;track kind=&quot;descriptions&quot;&gt; in other browsers seems non-existent: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/track#browser_compatibility

Here&apos;s an example for my use-case (Safari): https://www.bmas.de/SharedDocs/Videos/DE/Ministerium/Arbeiten-im-BMAS/bmas-was-arbeit-fuer-uns-ist.html
Play the video and activate the &quot;AD&quot; Button in the video controls for &quot;choppy&quot; audio description.

I boiled this down and it has nothing to do with MediaElement itself. Instead there seem to be two separate Webkit Bugs here:

1. Whenever I set the currentTime of an &lt;audio&gt; in Safari, even when I&apos;m just seeking a few milliseconds, I hear no audio for a moment until it resumes playing. In Chrome and Firefox the playback is much more consistent.
2. When I set the currentTime of an &lt;audio&gt; element, it is always a bit offset, not at the exact time I want to set it. Possibly a duplicate of https://bugs.webkit.org/show_bug.cgi?id=240568

In my use-case, both problems together result in a &quot;choppy&quot; playback because Safari keeps syncing the video and audio all the time due to my JS syncing logic. Here&apos;s my boiled-down example that reproduces the problem. Play the video, press the &quot;SYNC&quot; button and check in Safari console that the new currentTime is always a bit offset, resulting in the &quot;choppy&quot; audio playback.

&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.0&quot;&gt;
    &lt;title&gt;Safari Video Sync PoC&lt;/title&gt;
    &lt;style type=&quot;text/css&quot;&gt;
        video, audio {
            display: block;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;video id=&quot;video1&quot; width=&quot;750&quot; height=&quot;421&quot; controls preload=&quot;auto&quot; playsinline poster=&quot;https://delivery-aktion-mensch.stylelabs.cloud/api/public/content/2e7945298d864445b79c120be1eeb87c&quot;&gt;
        &lt;source src=&quot;https://delivery-aktion-mensch.stylelabs.cloud/api/public/content/0e7a69b999dc4dad8b632d323909d1a1&quot; type=&quot;video/mp4&quot; /&gt;
    &lt;/video&gt;
    &lt;audio id=&quot;audio1&quot; controls preload=&quot;auto&quot;&gt;
        &lt;source src=&quot;https://delivery-aktion-mensch.stylelabs.cloud/api/public/content/72091bbef9494cc6a8da57179d69099c&quot; type=&quot;audio/mp3&quot; /&gt;
    &lt;/audio&gt;
    &lt;button id=&quot;sync&quot; style=&quot;margin: 20px;padding: 20px;&quot;&gt;SYNC&lt;/button&gt;
    &lt;script&gt;
        const video = document.getElementById(&apos;video1&apos;);
        const audio = document.getElementById(&apos;audio1&apos;);
        const sync = document.getElementById(&apos;sync&apos;);

        video.addEventListener(&apos;playing&apos;, () =&gt; {
            video.volume = 0;
            audio.play();
        });

        video.addEventListener(&apos;pause&apos;, () =&gt; {
            audio.pause();
        });

        video.addEventListener(&apos;seeked&apos;, () =&gt; {
            audio.currentTime = video.currentTime;
        })

        video.addEventListener(&apos;timeupdate&apos;, () =&gt; {
            const timeDifference = Math.abs(video.currentTime - audio.currentTime);
            console.log(timeDifference);
            if (timeDifference &gt; 0.3) {
                audio.currentTime = video.currentTime;
            }
        });

        sync.addEventListener(&apos;click&apos;, () =&gt; {
            audio.currentTime = video.currentTime;
        });
    &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;

mediaelement a11y Plugin
Docs:
https://github.com/mediaelement/mediaelement-plugins/blob/master/docs/a11y.md
Source:
https://github.com/mediaelement/mediaelement-plugins/blob/master/src/a11y/a11y.js

Tested in Safari Version 26.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2175475</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-01-27 09:43:58 -0800</bug_when>
    <thetext>&lt;rdar://problem/169014726&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>