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

feat: enable picture-in-picture mode for video tags #17686

Merged
merged 6 commits into from Aug 22, 2019
Merged

Conversation

brenca
Copy link
Contributor

@brenca brenca commented Apr 3, 2019

Description of Change

This PR enables the picture-in-picture mode already available in chrome. This is partly a feat:, partly a fix: - without these changes, the DOM reports that PiP mode is available, but no actual window is created for it, and the DOM APIs return a 0x0 phantom PiP window. With these changes if PiP is disabled with the build flag, the DOM APIs correctly report that support for this feature is unavailable.

The added //chrome dependencies are self contained, but there are a couple of extra icons baked into the code when this feature is enabled. I'm happy to explore ways to only include the necessary icons, but we might we might end up with two folders with a small BUILD.gn in each that way, and I thought the easier maintainability/readability vs small size increase was worth it.

Resolves #17369 and #11582.

Checklist

Release Notes

Notes: Added support for picture-in-picture mode for video elements.

@brenca brenca requested a review from a team as a code owner April 3, 2019 19:52
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Apr 3, 2019
@brenca brenca changed the title feat: enable picture-in-picture mode for video tags feat: enable picture-in-picture mode for video tags [WIP] Apr 3, 2019
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Apr 4, 2019
@brenca brenca changed the title feat: enable picture-in-picture mode for video tags [WIP] feat: enable picture-in-picture mode for video tags Apr 11, 2019

#include "chrome/browser/ui/views/overlay/skip_ad_label_button.h"

-#include "chrome/grit/generated_resources.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anyway we can pull some compiler/ninja voodoo to make this work without a patch

cc @nornagon @deepak1556

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could consider refactoring upstream to make these resources more self-contained?

Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased it and tested locally, approving and requesting a 6-0-x backport as without it requesting a PiP view crashes

@deepak1556
Copy link
Member

requesting a 6-0-x backport as without it requesting a PiP view crashes

For 6-0-x I would suggest disabling PIP web apis through the embedder hooks https://groups.google.com/a/chromium.org/d/msg/embedder-dev/A4zqjsmibXc/Osy_LLZ0DwAJ. I don't see the reason to ship this feature.

@MarshallOfSound
Copy link
Member

@deepak1556 I want to do that for 5-0-x (disable it) but I'd like to make it possible to use this in 6-0-x

@deepak1556
Copy link
Member

LGTM, Can you fix the conflicts.

@ckerr
Copy link
Member

ckerr commented May 14, 2019

@brenca ping, can you fix the conflicts

@mohamedghan
Copy link

guys, i'm having a bad time trying to add pip in my project. i'm using electron 6.x.x beta15

@Ajeey
Copy link
Contributor

Ajeey commented Jul 31, 2019

Guys, any updates on this? Would love to see this ported to Electron!

@zcbenz zcbenz merged commit 9ccd6aa into master Aug 22, 2019
@zcbenz zcbenz deleted the brenca/pip-video branch August 22, 2019 10:18
@release-clerk
Copy link

release-clerk bot commented Aug 22, 2019

Release Notes Persisted

Added support for picture-in-picture mode for video elements.

@codebytere
Copy link
Member

/trop run backport-to 7-0-x

@trop
Copy link
Contributor

trop bot commented Aug 23, 2019

The backport process for this PR has been manually initiated,
sending your 1's and 0's to "7-0-x" here we go! :D

@trop
Copy link
Contributor

trop bot commented Aug 23, 2019

I was unable to backport this PR to "7-0-x" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Aug 23, 2019

A maintainer has manually backported this PR to "7-0-x", please check out #19914

@sofianguy sofianguy added this to Fixed in 7.0.0-beta.4 in 7.2.x Sep 3, 2019
@alirezavalizade
Copy link

I updated to electron v7, but it doesn't work correctly. Actually it has the feature on video tag controls but when you click on it, it doesn't show anything, I only see something like this.

image

@brenca @MarshallOfSound @zcbenz

@alectrocute
Copy link

Same issue here a few months after @alirezavalizade's comment above. This would be a really nice feature to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
7.2.x
Fixed in 7.0.0-beta.4
Development

Successfully merging this pull request may close these issues.

PiP Window is not created - v5.0.X