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

Add built-in Picture-in-Picture button #6002

Merged
merged 9 commits into from
Jun 18, 2019

Conversation

beaufortfrancois
Copy link
Contributor

@beaufortfrancois beaufortfrancois commented May 21, 2019

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

  • Feature implemented / Bug fixed [Support for picture-in-picture API #5824]
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
  • Reviewed by Two Core Contributors

Note that I'm creating this PR on top of #6001. You may want to look only at 75de129 and a2012c2

image

@gkatsev
Copy link
Member

gkatsev commented May 22, 2019

videojs-font@3.2.0 is now out with the pip icons

Copy link
Member

@gkatsev gkatsev left a 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?

@@ -67,7 +68,8 @@ ControlBar.prototype.options_ = {
'descriptionsButton',
'subsCapsButton',
'audioTrackButton',
'fullscreenToggle'
'fullscreenToggle',
'pictureInPictureToggle'
Copy link
Member

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.

Copy link
Contributor Author

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.

@gkatsev gkatsev added the needs: LGTM Needs one or more additional approvals label May 31, 2019
@beaufortfrancois
Copy link
Contributor Author

Also, I assume this would be rebased once #6001 is in?

Yes @gkatsev

@gkatsev
Copy link
Member

gkatsev commented Jun 3, 2019

Thanks!

@beaufortfrancois
Copy link
Contributor Author

@gkatsev I've rebased this PR. What else is left?

@gkatsev gkatsev added the tested label Jun 17, 2019
@gkatsev
Copy link
Member

gkatsev commented Jun 18, 2019

I've tried it with ad plugins, it fails as expected but it'll be handled elsewhere. Merging. Thanks so much @beaufortfrancois!

@gkatsev gkatsev removed the needs: LGTM Needs one or more additional approvals label Jun 18, 2019
@gkatsev gkatsev merged commit 116d84a into videojs:master Jun 18, 2019
@sobralik
Copy link

Is there a way to not include the button on player setup?
Similar to data-setup='{ "bigPlayButton" : false }'

@gkatsev
Copy link
Member

gkatsev commented Jul 11, 2019

@stafio you can! The following should do it:

{
  controlBar: { 
    'pictureInPictureToggle': false
  }
}

@sobralik
Copy link

That did it. Thanks @gkatsev!

@ckybonist
Copy link
Contributor

BTW, This option should be added into @types/video.js, currently the definition is:

interface ControlBarOptions extends ComponentOptions {
		volumePanel?: VolumePanelOptions;
		fullscreenToggle?: boolean;
	}

@surikat1978
Copy link

Hi!
Please tell me how to disable this button in new versions of the player ?
What is the point of integrating, which not everyone needs and even interferes with another.

@gkatsev
Copy link
Member

gkatsev commented Jan 17, 2020

How to disable it is posted here #6002 (comment)
This is a user-focused feature that we decided is beneficial and thus we have it enabled by default.

@surikat1978
Copy link

How to disable it is posted here #6002 (comment)
This is a user-focused feature that we decided is beneficial and thus we have it enabled by default.

Thanks! But it is not clear in which file and line to change this. min.js or min.css ?

@mister-ben
Copy link
Contributor

It's a setup option. How you use it depends on how you initiatalise the player:

videojs('my_player', {controlBar: {pictureInPictureToggle: false}});
data-setup='{"controlBar": {"pictureInPictureToggle": false}}'

@surikat1978
Copy link

surikat1978 commented Mar 23, 2020

How to disable it is posted here #6002 (comment)
This is a user-focused feature that we decided is beneficial and thus we have it enabled by default.

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.

@surikat1978
Copy link

It's a setup option. How you use it depends on how you initiatalise the player:

videojs('my_player', {controlBar: {pictureInPictureToggle: false}});
data-setup='{"controlBar": {"pictureInPictureToggle": false}}'

Thanks very much!

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

Successfully merging this pull request may close these issues.

7 participants