You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: