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

pip prop does not initiate pip #694

Closed
readeral opened this issue Aug 14, 2019 · 6 comments
Closed

pip prop does not initiate pip #694

readeral opened this issue Aug 14, 2019 · 6 comments

Comments

@readeral
Copy link

Be sure to search for your issue before opening a new one.

Current Behavior

pip prop doesn't actually enable pip. Using the demo app, pip control is never showing up in the regardless of source, and using React dev tools to toggle the prop on and off does nothing.

Expected Behavior

Expected to see the pip control button at least for something... and expected toggling the pip prop to turn pip on

Steps to Reproduce

  1. Visit https://cookpete.com/react-player/
  2. Load every test source

Environment

Other Information

@readeral
Copy link
Author

I've tried using a ref to initiate pip on the video object - but the

I don't know enough about refs to know if I can target the

@cookpete
Copy link
Owner

cookpete commented Sep 5, 2019

If manually calling requestPictureInPicture on the element is working then something weird must be going on, as that's exactly what ReactPlayer does

Note that pip is only currently supported when playing video files in recent versions of Chrome. I can visit https://cookpete.com/react-player in Chrome 76 on macOS and PIP works fine for any of the Files URLs (apart from the mp3):

image

Also note that there is a static method to check if PIP is supported: ReactPlayer.canEnablePiP(url)

@readeral
Copy link
Author

readeral commented Sep 5, 2019

Ah.. "when playing video files" is the key. I didn't get as far down the list as testing the files - gave up at DailyMotion! Thanks for helping me troubleshoot.

I couldn't determine that this is a limitation to the Chrome implementation. Can you point me in the direction of where to find info on this?

Would also be helpful to have this limitation visible in the Readme :)

@cookpete
Copy link
Owner

I couldn't determine that this is a limitation to the Chrome implementation. Can you point me in the direction of where to find info on this?

https://developers.google.com/web/updates/2018/10/watch-video-using-picture-in-picture

@kenakingkong
Copy link

Did you figure out how to work PiP with the youtube & other embeds?

@readeral
Copy link
Author

readeral commented Jan 27, 2021

@kenakingkong it's a limitation of the API that you need to have access to the <video> tag, and where youtube et al use iframe, you run into same-origin issues trying to reach in and call the PIP function. So until these streaming providers expose an API for PIP that is easily included in this library, we're stuck with file-only PIP.

albanqoku added a commit to albanqoku/react-player that referenced this issue Feb 24, 2021
Webmaster1116 added a commit to Webmaster1116/video-player that referenced this issue May 20, 2021
webmiraclepro added a commit to webmiraclepro/video-player that referenced this issue Sep 9, 2022
philip-luther added a commit to philip-luther/react-player that referenced this issue Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants