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

Fix fallback code and increase compatibility with older browsers #13

Merged
merged 1 commit into from
Oct 5, 2020

Conversation

zopieux
Copy link
Contributor

@zopieux zopieux commented Oct 3, 2020

  • using this.ctx.getOutputTimestamp().contextTime || (fallback) does not have the intended effect of falling back if getOutputTimestamp doesn't exist because calling it throws a JS exception (infamous undefined is not a function). This fixes the problem by checking the function exists first.
  • I'm running Snapweb on a smart TV with an ancient Chrome build (53.0 from 2016) and can only get it to work if AudioContext has no constructor options.

* using `this.ctx.getOutputTimestamp().contextTime || (fallback)` does not have the intended effect of falling back if `getOutputTimestamp` doesn't exist because calling it throws a JS exception (infamous *undefined is not a function*). This fixes the problem by checking the function exists first.
* I'm running Snapweb on a smart TV with an ancient Chrome build (53.0 from 2016) and can only get it to work if `AudioContext` has no constructor options.
@badaix badaix merged commit 4b3f5a8 into badaix:master Oct 5, 2020
@badaix
Copy link
Owner

badaix commented Oct 5, 2020

Thanks!

@zopieux zopieux deleted the old-compat branch October 5, 2020 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants