Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recorder plugin in Firefox generates continuous errors #4039

Open
SteveALee opened this issue Feb 21, 2025 · 0 comments
Open

Recorder plugin in Firefox generates continuous errors #4039

SteveALee opened this issue Feb 21, 2025 · 0 comments
Labels

Comments

@SteveALee
Copy link
Contributor

SteveALee commented Feb 21, 2025

Bug description

When using the record plugin in firefox a continuous stream of erros occur in the developer tools console. This slows down drawing, making it lumpy. I expect the impact is minimal if dev tools are closed

Invalid URI. Load of media resource failed.

This error is not seen in the examples webpages as the iframe seems to lose the error. I converted the record.js example into a html page and served that from the waversurfer source and it is reproducable.

I can't find much info but it seems at some point Firefox devs decided to generate errors for setting invalid player media src values. the wavesurfer record plug triggers this by setting the player.js audio elements src property to an empty string which is invalid.

The code is in plugins/record.js renderMicStream -> drawWaveform

         this.wavesurfer
          .load(
            '',
            [this.dataWindow],
            this.options.scrollingWaveform ? this.options.scrollingWaveformWindow : totalDuration,
          )

To work around I don't set media.src in player.js if newsrc is falsey. ie

    if (newSrc) {
      try {
        this.media.src = newSrc
      } catch (e) {
        this.media.src = url
      }
    }

But the error will still occur if media.src was already set and so is reset to ''. However that seems to be a workaround for a browser bug, which may have been fixed.

This daft behaviour by Firefox as getSrc() returns '' but setSrc of '' logs an error.

Happy to provide a PR

Environment

  • Browser: Firefox - no prob in Chrome or Edge (on Windows)

Minimal code snippet

The Record.js example converted to a HTML page and using npx server .

Expected result

No stream of errors

Obtained result

Stream of errors

Screenshots

@SteveALee SteveALee added the bug label Feb 21, 2025
@SteveALee SteveALee changed the title Recorder plugin in Firefox generates continuoues errors Recorder plugin in Firefox generates continuous errors Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant