react-player
react-player copied to clipboard
FilePlayer: Autoplay attribute is changing every time the user click on play/pause button.
Current Behavior
When you use FilePlayer (html5) each time the user click on play - autoplay attribute is added. And versa, clicking in pause - autoplay attribute is removed.
Expected Behavior
Autoplay attribute should not rely on 'playing' props.
Steps to Reproduce
It even reproduces on official demo page
- Go to https://cookpete.com/react-player/
- Click on controls (to ensure you can manipulate with built-it buttons)
- Choose mp4 format
- Look at the console: autoplay attribute is added every time you click on play button and removed when you pause video.
If I look at the code, I see in file https://github.com/cookpete/react-player/blob/master/src/players/FilePlayer.js line 359 autoPlay={playing || undefined}, which does exactly what was described. However, this is not how autoplay should work by default.
It cause many issues with analytics tracking, when you have lazy video loading and disabled autoplay. User clicks on play - autoplay attribute is added.