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

Audio sometimes doesn't play on refresh #64

Open
trujic1000 opened this issue Jul 30, 2019 · 2 comments
Open

Audio sometimes doesn't play on refresh #64

trujic1000 opened this issue Jul 30, 2019 · 2 comments

Comments

@trujic1000
Copy link

image

Audio sometimes just doesn't start on page refresh, it is not consistent too. Sometimes I will refresh 5 times and it will play normally, and then it won't play at all next couple of times etc.

onCanPlay event listener always fires as normal and onError doesn't log anything.
Sometimes when it doesn't play, p tag appears with Your browser doesn't support audio element.
I am using Chrome.

Anyone had the same problem?

@irhamputra
Copy link

@trujic1000 hey! I've been using this component too but actually there some major problem. But basically this is a just a wrapper audio tag HTML5. You can build your own audio with pure JS by yourself reference audio tag in MDN

@Serranosoft
Copy link

image

Audio sometimes just doesn't start on page refresh, it is not consistent too. Sometimes I will refresh 5 times and it will play normally, and then it won't play at all next couple of times etc.

onCanPlay event listener always fires as normal and onError doesn't log anything.
Sometimes when it doesn't play, p tag appears with Your browser doesn't support audio element.
I am using Chrome.

Anyone had the same problem?

Try using muted prop in as browsers disables autoplay if the player has not a muted propperty

example below

<ReactAudioPlayer
src={soundtrack}
listenInterval={1000}
autoplay
muted
loop
volume={soundtrack || 0.7}
/>

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

No branches or pull requests

3 participants