WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
285391
HTML audio element currentTime property too high when setting srcObject to MediaStream (macOS and iOS)
https://bugs.webkit.org/show_bug.cgi?id=285391
Summary
HTML audio element currentTime property too high when setting srcObject to Me...
vladik.mashk
Reported
2025-01-04 16:27:04 PST
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/
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"/> </head> <body> <audio id="audioElement" autoplay></audio> <div>Time passed: <span id="timePassed"></span></div> <script type="module"> const audioElement = document.getElementById("audioElement"); const stream = await navigator.mediaDevices.getUserMedia({audio: true}); audioElement.srcObject = stream; setInterval(() => { document.getElementById("timePassed").innerText = audioElement.currentTime; }, 1000) </script> </body> </html>
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2025-01-07 01:44:03 PST
<
rdar://problem/142465970
>
youenn fablet
Comment 2
2025-01-07 01:48:37 PST
Pull request:
https://github.com/WebKit/WebKit/pull/38633
EWS
Comment 3
2025-01-07 04:59:13 PST
Committed
288519@main
(8194ca4f8b6f): <
https://commits.webkit.org/288519@main
> Reviewed commits have been landed. Closing PR #38633 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug