jsantell / jsantell/dancer.js

Uncaught Error(s) when playing live streams?

Open
#54 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2.1k
Forks
202
PR merge metrics
No merged PRs in 30d

Description

From line 48 of adapterWebAudio.js
this.audio.addEventListener( 'progress', function ( e ) {
if ( e.currentTarget.duration ) {
_this.progress = e.currentTarget.seekable.end( 0 ) / e.currentTarget.duration;
}
});

Causes an Uncaught IndexSizeError: Failed to execute 'end' on 'TimeRanges': The index provided (0) is not less than the object's length (0).

This occurs when I use sources like shoutcast and icecast.
This is fixable if you nest this condition if(e.currentTarget.seekable.length>0) inside the function.
This doesn't appear to be a problem in Chrome, it just runs through the error anyway. However, I'm guessing/hoping that a similar type of error for the mozilla adapter is preventing firefox from using live mp3 streams (it appears firefox can play and visualize local mp3's just fine).
Awesome project though I'm hooked on the demo.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read adapterWebAudio.js around line 48 and reproduce the issue with Shoutcast or Icecast live streams. Check the progress handler's seekable range behavior and compare Firefox playback with local MP3s. Done means live streams no longer produce the reported IndexSizeError and Firefox behavior is understood.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
audio-video-rtc
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.