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

Check player is not null before player.trigger('resize') event #760

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Dananji
Copy link
Collaborator

@Dananji Dananji commented Jan 10, 2025

When switching manifests in demo site using Set Manifest form, the player instance is set to null momentarily. During this window player.trigger('resize') is getting called because, the resize event on window is fired when the component tree is cleared when manifest URL in the Set Manifest form is emptied or changed.

Adding this check prevents the code from trying to emit the 'resize' event on a null instance of the player causing the page to crash. However this doesn't break the resize functionality, as this function is called again when player instance is properly set.

Copy link
Member

@cjcolvar cjcolvar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

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