Skip to content

Use ResizeObserver to cap level to player size - #7108

Merged
robwalch merged 2 commits into
masterfrom
feature/resize-observer
Sep 26, 2025
Merged

Use ResizeObserver to cap level to player size#7108
robwalch merged 2 commits into
masterfrom
feature/resize-observer

Conversation

@robwalch

@robwalch robwalch commented Mar 19, 2025

Copy link
Copy Markdown
Collaborator

This PR will...

Use ResizeObserver when available in cap-level-controller.

Improve buffer removal boundary used in fast switch-up to reduce stalling, for in live playback.

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

Comment thread src/controller/cap-level-controller.ts Outdated
@robwalch
robwalch force-pushed the feature/resize-observer branch from f8ad58a to 1739040 Compare July 14, 2025 22:38
@robwalch robwalch moved this from In progress to Review in progress in HLS.js Performance Aug 14, 2025
@robwalch robwalch moved this from Nice to have to Top priorities in HLS.js Release Planning and Backlog Aug 26, 2025
@robwalch
robwalch force-pushed the feature/resize-observer branch from 4f8a2a8 to 1b921b8 Compare August 27, 2025 15:03
@robwalch
robwalch removed the request for review from cjpillsbury September 26, 2025 17:19
@robwalch
robwalch merged commit 917155d into master Sep 26, 2025
16 checks passed
@robwalch
robwalch deleted the feature/resize-observer branch September 26, 2025 17:20
@github-project-automation github-project-automation Bot moved this from Review in progress to Done in HLS.js Performance Sep 26, 2025
@robwalch robwalch mentioned this pull request Sep 26, 2025
3 tasks
@robwalch robwalch moved this from Top priorities to Done in HLS.js Release Planning and Backlog Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant