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

feat: reinitialize player on changes in player config or UI config #12

Merged
merged 8 commits into from
Jun 21, 2024

Conversation

karpov-kir
Copy link
Contributor

@karpov-kir karpov-kir commented Jun 20, 2024

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.

@karpov-kir karpov-kir requested a review from felix-hoc June 20, 2024 14:17
Copy link
Contributor

@felix-hoc felix-hoc left a 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 ✌🏼

return () => {
destroyPlayer(initializedPlayer, rootContainerElement, createdPlayerContainerElement);
};
}, [config, customUi, playerRefProp]);
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@karpov-kir karpov-kir requested a review from felix-hoc June 21, 2024 12:16
@karpov-kir karpov-kir merged commit 2a2b9b6 into main Jun 21, 2024
4 checks passed
@karpov-kir karpov-kir deleted the feature/FE-189-reinitialize-on-config-changes branch June 21, 2024 12:18
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

Successfully merging this pull request may close these issues.

2 participants