rainner / soma-fm-player

This is a Vue.js web application for streaming radio stations from Somafm.com. This app uses the public SomaFM JSON channels API endpoint to pull in a list of stations and makes it easy to switch between stations. This app also uses Three.js and the HTML5 Web Audio Context API to sample audio data and create a visualizer effect for the selected station.
MIT License
139 stars 32 forks source link

The AudioContext was not allowed to start. Chrome. #7

Open madbeyk opened 4 years ago

madbeyk commented 4 years ago

Any quick workaround for this?

The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu eval @ audio.js?dd07:6

It seems that in new versions of Chrome there is a new policy to block automatic start of audio. It can be started just after some user action on page.

madbeyk commented 4 years ago

I've made dirty and quick workaround. Player is not starting (playing stream) automatically after load in Chrome. It needs user intent (select channel or press play button). https://github.com/madbeyk/soma-fm-player/commit/32d7f312ffdfb0fac46c34855e6a9bc2587440eb Maybe it needs further testing or improvements.

rainner commented 4 years ago

Hey @madbeyk, thanks for pointing that out. I'll look into it and try to implement the fix you came up with.