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

[Bug] Failed to construct 'AudioContext' #2

Closed
SohrabZ opened this issue Feb 14, 2018 · 2 comments
Closed

[Bug] Failed to construct 'AudioContext' #2

SohrabZ opened this issue Feb 14, 2018 · 2 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@SohrabZ
Copy link

SohrabZ commented Feb 14, 2018

I'm receiving this error in my web page:

DOMException: Failed to construct 'AudioContext': The number of hardware contexts provided (6) is greater than or equal to the maximum bound (6).

I have multiple audio players on my website and here is my implementation:

<av-line
        :line-width="2"
        line-color="lime"
        :audio-src="scope.row.recording_url"
        ref="popover_rec_{{scope.row.id}}"
        v-if="recording_visible">
</av-line>
@SohrabZ
Copy link
Author

SohrabZ commented Feb 14, 2018

UPDATE

I've tried to fix this by changing AvBase.js to this:

const methods = {
  ...
  setAnalyser: function () {
    const myCtx = new AudioContext()
    this.myCtx = myCtx
    const src = myCtx.createMediaElementSource(this.audio)
    this.analyser = myCtx.createAnalyser()

    src.connect(this.analyser)
    this.analyser.fftSize = this.fftSize
    this.analyser.connect(myCtx.destination)
  },
  ...
}

export default {
  ...
  beforeDestroy () {
      this.myCtx.close()
  },
  ...
}

and adding v-if to your <av-*></av-*> components

@staskobzar staskobzar self-assigned this Feb 14, 2018
@staskobzar staskobzar added enhancement New feature or request bug Something isn't working labels Feb 14, 2018
@staskobzar
Copy link
Owner

The fix will be available in next release. For now it will support up to 6 audio contexts as allowed by browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants