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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Fixes NaN aspect ratio issue #2505

Merged
merged 1 commit into from
Dec 26, 2023

Conversation

themisir
Copy link
Contributor

Fixes #2504 - please check the linked issue for more details about the issue.

Instead of relying solely on onloadedmetadata callback, it's been recommended to use onloadeddata instead. I suppose loadedmetadata gets called earlier in most cases, so it still makes sense to use it to initialize player view, however I added a flag and a onloadeddata callback to handle the case where the loadedmetadata callback is called while the element video size attributes have not been initialized (or initialized with 0 value).

This ensures the player aspect ratio never gets set to NaN and provides an alternative way to correct the default 16:9 ratio if necessary.

@themisir themisir changed the title Fixes NaN aspect ratio issue 馃悰 Fixes NaN aspect ratio issue Dec 24, 2023
@moisout
Copy link
Member

moisout commented Dec 26, 2023

Wow, thank you very much! Code looks good.

@moisout moisout merged commit bb33ec9 into ViewTube:development Dec 26, 2023
5 checks passed
@moisout
Copy link
Member

moisout commented Dec 26, 2023

@all-contributors please add @themisir for code

Copy link
Contributor

@moisout

I've put up a pull request to add @themisir! 馃帀

@themisir themisir deleted the nan-aspect-ratio branch December 27, 2023 14:21
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.

Video player is not displaying
2 participants