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

Update config.js #374

Merged
merged 1 commit into from
May 29, 2020
Merged

Update config.js #374

merged 1 commit into from
May 29, 2020

Conversation

klh
Copy link
Contributor

@klh klh commented Aug 9, 2019

don't initialize window.Audio as part of an automatic setup, it will Barf in packagers such as webpack et.all.
instead make it part of the init call - like so:

 Amplitude.init({
      audio: new Audio(),
      bindings: {
        37: 'prev',
        39: 'next',
        32: 'play_pause',
      })

or alternatively wrap it in a conditional if(window && window.Audio)

don't initialize window.Audio as part of an automatic setup, it will Barf in packager such as webpack, rollbar etc.
instead make it part of the init call - like so:
```
 Amplitude.init({
      audio: new Audio(),
      bindings: {
        37: 'prev',
        39: 'next',
        32: 'play_pause',
      })
```

or alternatively wrap it in a conditional ```if(window && window.Audio)```
@danpastori danpastori merged commit 7cabc0e into serversideup:master May 29, 2020
@danpastori
Copy link
Contributor

Thank you for submitting your PR! I'll make the change to initialize the audio on init.

@danpastori
Copy link
Contributor

With the last PR of #420 , we can set this to null and the audio will get initialized through the changeSong method. This is convenient since we change the song to be the initialized song.

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.

None yet

2 participants