Skip to content

Use ResizeObserver to cap level to player size #7108

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

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

Conversation

robwalch
Copy link
Collaborator

This PR will...

Use ResizeObserver when available in cap-level-controller.

Why is this Pull Request needed?

Using capLevelToPlayerSize to detect the media element dimensions forces layout. The ResizeObserver avoids this speeding up player setup.

Are there any points in the code the reviewer needs to double check?

Might want to debounce calling this.detectPlayerSize in the observer callback to avoid setting the level more than once when the media element size is animated by the browser during transitions like entering and exiting fullscreen.

Resolves issues:

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

1 participant