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

DOMException - Chrome Version 72.0.3626.96 #566

Closed
MRMTC opened this issue Feb 10, 2019 · 2 comments
Closed

DOMException - Chrome Version 72.0.3626.96 #566

MRMTC opened this issue Feb 10, 2019 · 2 comments

Comments

@MRMTC
Copy link

MRMTC commented Feb 10, 2019

Hi @cookpete :)

When the below code is called on my website, on initial load:
<ReactPlayer ref='reactPlayer' className='react-player' width='100%' height='100%' url= {song} playing={playing} loop={loop} volume={volume} muted={muted} playsinline={playsinline} onEnded={this.onEnded} onError={e => console.log('onError', e)} //fileConfig={{ attributes: {autoPlay: {autoplay} }}} />

I get the following output on the console: "onError DOMException"

So the DOMException is being returned as the error. If I refresh the page, the player starts automatically playing. Almost as if something was cached that allows it to automatically play now. Value of the parameters I am passing through is as follows:
state = { playing: true, autoplay: true, volume: 1.0, muted: false, loop: false, playsinline: true, song: songs[0] }//end state

Previously I never use to get an error, and the code seems to work fine on for example Firefox where on initial load; the song starts playing automatically. I am using version 1.9.3 of your library.

Is the Chrome Desktop browser perhaps working like the "mobile" browser where auto play is initially not allowed?

Please let me know if you need any further information in order to assist.

@cookpete
Copy link
Owner

This sounds like Chrome's new default behaviour to stop non-muted video or audio from autoplaying.

Discussion here: #395

It sounds like Chrome is happy with the audio playing once a user has interacted with the page, even after a refresh? I'm not certain on this but it sounds a bit strange either way.

Try turning off chrome's autoplay policy. If it works correctly, then that must be it. If it's something else then feel free to reopen the issue with more details.

You can decide to disable entirely the autoplay policy by setting the Chrome flag "Autoplay Policy" to "No user gesture is required" at chrome://flags/#autoplay-policy. This allows you to test your website as if user were strongly engaged with your site and playback autoplay would be always allowed.

https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#developer-switches

@MRMTC
Copy link
Author

MRMTC commented Feb 11, 2019

Hi @cookpete :)

As usual, thanks for the quick reply on this. Will have a look at the resources above and let you know if I discover anything on my end.

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

2 participants