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

Safari 14 support. #64

Open
stijndeschuymer opened this issue Feb 8, 2021 · 5 comments
Open

Safari 14 support. #64

stijndeschuymer opened this issue Feb 8, 2021 · 5 comments

Comments

@stijndeschuymer
Copy link

Hi, Thanks for your great library. I noticed the following:
This line fails in Safari 14: https://github.com/t-mullen/video-stream-merger/blame/cf54b5fe3bc4f5624d719b064874e615757c8a12/src/index.js#L61

So either this needs to be added to the audioSupport check https://github.com/t-mullen/video-stream-merger/blob/gh-pages/src/index.js#L11

But I'd prefer to fix this _backgroundAudioHack function.
maybe createConstantSource() could be replaced by AudioContext.createOscillator() ?
Wdyt?

Thanks!

@gut4
Copy link

gut4 commented Mar 25, 2021

https://github.com/chrisguttandin/standardized-audio-context Maybe this can help?

@hthetiot
Copy link
Contributor

hthetiot commented Jun 28, 2021

Fixed by #71 , I can do separate PR if needed

_createConstantSource() {

    if (this._audioCtx) {
      if (this._audioCtx.createConstantSource) {
        return this._audioCtx.createConstantSource();
      }

      // not really a constantSourceNode, just a looping buffer filled with the offset value
      const constantSourceNode = this._audioCtx.createBufferSource();
      const constantBuffer = this._audioCtx.createBuffer(1, 1, this._audioCtx.sampleRate);
      const bufferData = constantBuffer.getChannelData(0);
      bufferData[0] = (0 * 1200) + 10;
      constantSourceNode.buffer = constantBuffer;
      constantSourceNode.loop = true;

      return constantSourceNode;
    }
  }

@hthetiot
Copy link
Contributor

Fixing createConstantSource and moving canvas creation to start did the trick.

@hthetiot
Copy link
Contributor

hthetiot commented Jul 6, 2021

Fixed in 4.0.0 release.

@t-mullen
Copy link
Owner

t-mullen commented Jul 7, 2021

@stijndeschuymer Please close this issue if it is solved in 4.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants