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

Use PiP window size when abr.restrictToElementSize is true #7872

Closed
absidue opened this issue Jan 10, 2025 · 3 comments · Fixed by #7880 or #7882
Closed

Use PiP window size when abr.restrictToElementSize is true #7872

absidue opened this issue Jan 10, 2025 · 3 comments · Fixed by #7880 or #7882
Assignees
Labels
priority: P3 Useful but not urgent type: enhancement New feature or request
Milestone

Comments

@absidue
Copy link

absidue commented Jan 10, 2025

Have you read the FAQ and checked for duplicate open issues?
Yes

Is your feature request related to a problem? Please describe.

The picture-in-picture window is usually a different size to the video element on the page, as most browsers default to a small PIP window. As shaka-player currently only looks at the size of the video element, it uses larger variants than needed when PIP is enabled.

Describe the solution you'd like

HTMLVideoElement#requestPictureInPicture returns a PictureInPictureWindow that contains the width and height of the picture-in-picture window as well as a resize event. shaka-player could forward the dimensions of the window and any changes to them from the PipButton component to the ABR manager, where it could be used for making decisions about which variant to use.

https://developer.mozilla.org/en-US/docs/Web/API/PictureInPictureWindow

Describe alternatives you've considered

Leaving as is. This feature request is about optimising resource usage, so if it isn't implemented it's not like there will be "missing" functionality.

Additional context

Are you planning to send a PR to add it?

As this would require changes to the ABR manager interface, it is probably best to leave it to the experts.

@absidue absidue added the type: enhancement New feature or request label Jan 10, 2025
@shaka-bot shaka-bot added this to the Backlog milestone Jan 10, 2025
@avelad avelad added the priority: P3 Useful but not urgent label Jan 13, 2025
@avelad avelad self-assigned this Jan 13, 2025
@avelad avelad modified the milestones: Backlog, v4.13 Jan 13, 2025
@avelad
Copy link
Member

avelad commented Jan 13, 2025

@absidue I created a PR to implement this --> #7880 Can you review it? Thanks!

@avelad
Copy link
Member

avelad commented Jan 13, 2025

@absidue #7882 :)

@absidue
Copy link
Author

absidue commented Jan 13, 2025

Looks great to me, thank you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: P3 Useful but not urgent type: enhancement New feature or request
Projects
None yet
3 participants