-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: reinitialize player on changes in player config or UI config #12
feat: reinitialize player on changes in player config or UI config #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's check the ref, otherwise LGTM ✌🏼
src/BitmovinPlayer.tsx
Outdated
return () => { | ||
destroyPlayer(initializedPlayer, rootContainerElement, createdPlayerContainerElement); | ||
}; | ||
}, [config, customUi, playerRefProp]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, let's check if there are any bad effects from having the ref as a dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it can be done as a separate use effect hook to avoid player reinitialization on the ref property changes - f0703e6.
Related to: https://bitmovin.atlassian.net/browse/FE-189.
I've been working on the integration of this wrapper into our dashboard during the FE community days and noticed that sometimes we need to keep track of changes in the config and reinitialize the player.
This PR extends the wrapper to also track changes in the configs and reinitialize the player.