question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duration audio Infinity

See original GitHub issue

In the following function I send the URL, my problem is that the audio.duration gives me Infinity.

function recordingEndedCallback (urlBlob) {
  var audio = new Audio()
  audio.src = urlBlob
  audio.addEventListener('loadedmetadata', () => {
    console.log(audio.duration)
  }, false)
}

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
iamsrujalcommented, Apr 14, 2022

I have integrated below solution. (It’s working fine in desktop Chrome Version 100.0.4896.75 (Official Build) (64-bit)) Still need confirmation from different OS and browser.

image

In order to get the duration inside recorded file we have to add ts-ebml dependency. I have used webm-duration-fix npm.

By integrating above solution it’s fixed my recording duration issue but still need to test in other OS and browsers.

I did some test in android and IOS latest version by today date (14/04/2022).

It’s working fine.

0reactions
iamsrujalcommented, Apr 14, 2022

I have integrated below solution. (It’s working fine in desktop Chrome Version 100.0.4896.75 (Official Build) (64-bit)) Still need confirmation from different OS and browser.

image

In order to get the duration inside recorded file we have to add ts-ebml dependency. I have used webm-duration-fix npm.

By integrating above solution it’s fixed my recording duration issue but still need to test in other OS and browsers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

html audio tag, duration always infinity - Stack Overflow
The audio plays alright, but the duration property of the audio tag is always returning infinity. I tried the accepted answer to this...
Read more >
HTML : html audio tag, duration always infinity - YouTube
HTML : html audio tag, duration always infinity [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] HTML : html audio tag, ...
Read more >
Audio element duration returns "Infinity" when website is ...
For an unknown reason the “duration” of the audio element now returns “Infinity”, and this prevents the audio player from working properly.
Read more >
Infinity Audio/Video Duration Issue Fixed Using JavaScript
Unfortunately, with some Audio/Video we will see the duration as Infinity. A chrome bug that causes the duration not to be available under ......
Read more >
HTMLMediaElement.duration - Web APIs | MDN
If the element's media doesn't have a known duration—such as for live media streams—the value of duration is +Infinity .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found