lhz516 / react-h5-audio-player

React audio player component with UI. It provides time indicator on both desktop and mobile devices.
https://codepen.io/lhz516/pen/dyGpmgP
MIT License
587 stars 91 forks source link

Why is autoPlayAfterSrcChange set to true by default? #224

Closed emao closed 3 months ago

emao commented 3 months ago

Is there a reason autoPlayAfterSrcChange = true by default? I was chasing down a bug where the player would randomly start playing even when autoPlay = false. Turns out the issue was this setting was enabled by default. I suspect my src sometimes flickers between set and unset when React renders.

It also doesn't respect the autoPlay setting by current design. I'd expect it to not autoPlayAfterSrcChange if auto = false

Wondering why this was the set default and if I'm missing a use case here. Thanks.

lhz516 commented 3 months ago

I believe the reason would be backward compatibility concern.