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

FilePlayer: Autoplay attribute is changing every time the user click on play/pause button. #1657

Open
hamanovich opened this issue Aug 3, 2023 · 0 comments

Comments

@hamanovich
Copy link

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

  1. Go to https://cookpete.com/react-player/
  2. Click on controls (to ensure you can manipulate with built-it buttons)
  3. Choose mp4 format
  4. 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.

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

1 participant