-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
feat: Add document picture-in-picture support #8113
Conversation
Codecov Report
@@ Coverage Diff @@
## main #8113 +/- ##
==========================================
+ Coverage 82.11% 82.23% +0.12%
==========================================
Files 112 112
Lines 7402 7430 +28
Branches 1785 1791 +6
==========================================
+ Hits 6078 6110 +32
+ Misses 1324 1320 -4
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Co-authored-by: François Beaufort <[email protected]>
Co-authored-by: François Beaufort <[email protected]>
Co-authored-by: François Beaufort <[email protected]>
It seems like all TODOs have been checked. Is there anything left before merging this PR? |
@mister-ben this feature is absolutely amazing 🥇 I was testing the feature and I came across a case that does not seem to be supported. With Apple's bipbop the audio menu is cut off since there is no longer a full screen button next to the audio or subtitles button. When the player is not in picture-in-picture document it is not an issue because the menu is able to overflow.
|
.vjs-pip-window .vjs-menu-button-popup .vjs-menu { | ||
left: unset; | ||
right: 1em; // Extra offset for last menu button in pip window, as fullscreen button not present | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider this temporary. This needs a better solution longer term that only modifies the last visible menu, but this situation could apply in situations other than PiP so deserves tackling separately to thi PR.
Co-authored-by: François Beaufort <[email protected]>
Description
Implements Document Picture in Picture API, fixes #8108
Preview at https://deploy-preview-8113--videojs-preview.netlify.app/sandbox/docpip.html
Specific Changes proposed
Adds a
enableDocumentPictureInPicture
player option, to use the doc PIP API where available.Inserts an el with the player el's classes as a placeholder. Adds poster and titlebar to the placeholder if present.
To do / to discuss
disablePictureInPicture
will also disable this?This is implemented so that the current API / control triggers either
window.documentPictureInPicture
(docPiP) orvideo.requestPictureInPicure
(elPiP). The same events will fire. Promises will be returned when entering and exiting.enableDocumentPictureInPicture
option.disablePictureInPicture
option.The assumption is an integrator will generally prefer docPiP, so controls, ads, etc can be used. Therefore
disablePictureInPicture
does not disable docPiP, even if that may initially seem unintuitive.