-
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
Add built-in Picture-in-Picture button #6002
Conversation
ab33039
to
75de129
Compare
videojs-font@3.2.0 is now out with the pip icons |
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.
Also, I assume this would be rebased once #6001 is in?
src/js/control-bar/control-bar.js
Outdated
@@ -67,7 +68,8 @@ ControlBar.prototype.options_ = { | |||
'descriptionsButton', | |||
'subsCapsButton', | |||
'audioTrackButton', | |||
'fullscreenToggle' | |||
'fullscreenToggle', | |||
'pictureInPictureToggle' |
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.
I'd expect the fullscreen toggle to still be the right-most button, so, this would have to go above it.
I'm still a bit concerned on whether this can have issues, particularly in ad-plugins that often create their own control bar if it's included by default.
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.
Fullscreen toggle button is now the right-most button. I've updated screenshot as well.
Thanks! |
0de2ed3
to
787c890
Compare
787c890
to
3aaaa20
Compare
@gkatsev I've rebased this PR. What else is left? |
I've tried it with ad plugins, it fails as expected but it'll be handled elsewhere. Merging. Thanks so much @beaufortfrancois! |
Is there a way to not include the button on player setup? |
@stafio you can! The following should do it: {
controlBar: {
'pictureInPictureToggle': false
}
} |
That did it. Thanks @gkatsev! |
BTW, This option should be added into
|
Hi! |
How to disable it is posted here #6002 (comment) |
Thanks! But it is not clear in which file and line to change this. min.js or min.css ? |
It's a setup option. How you use it depends on how you initiatalise the player:
|
If broadcast video with subtitles, in this case, this function is useless. Of course, can kill it using the data setup. But it would be more correct to make a version with and without a button. |
Thanks very much! |
Description
Following #5824 (comment), this PR adds support for a built-in Picture-in-Picture button in the control bar. This API is described in the spec and article
Specific Changes proposed
This PR is about a new
PictureInPictureTogggle
component in the controls bar of the player. It depends on videojs/font#41 for icons.Requirements Checklist
Note that I'm creating this PR on top of #6001. You may want to look only at 75de129 and a2012c2