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

Improve video player performance #41

Open
nicmart-dev opened this issue May 30, 2024 · 0 comments
Open

Improve video player performance #41

nicmart-dev opened this issue May 30, 2024 · 0 comments

Comments

@nicmart-dev
Copy link
Owner

nicmart-dev commented May 30, 2024

Feedback from educators:

  • Really nice work creating the custom video player in your React App! That being said the set state function setCurrentTime is running many times which could be more performant if you use a ref instead. Set state functions cause a re-render of components using the state data which can be an expensive task, for example if you made a game where a function runs 60 times per second using set state would not be ideal. If you attach a ref to the progress bar, or video element, you could use the ref to update the progress bar without causing a re-render, leading to better performance. Not necessarily an issue for a smaller project although generally reducing the number of times a component renders is something you can aim to achieve with React.
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