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

Many video sources aren't opening Safari's PiP now (this includes new YouTube, Vimeo, Twitch, Netflix, and others!) #37

Open
KZeni opened this issue May 12, 2017 · 9 comments

Comments

@KZeni
Copy link

KZeni commented May 12, 2017

I'm using Safari Technology Preview 29, and it seems Pipifier isn't able to convert YouTube & other video services into a PiP if they're using a blob: URL as the

For example, I can use document.getElementsByTagName('video')[0] to pull the exact YouTube video player element, but then document.getElementsByTagName('video')[0].webkitSetPresentationMode('picture-in-picture'); just returns "undefined" and the PiP isn't triggered. Meanwhile, it appears that you can use the right-click & then right-click again on the YouTube video player to then choose the PiP option from Safari's context menu to have it work just fine.

I'm not sure if this is something WebKit/Safari needs to fix for PiPifier to function or if there's something needing to be updated within PiPifier. I figured I'd mention the issue I came across.

@KZeni
Copy link
Author

KZeni commented May 12, 2017

I have submitted what appears to be a bug with Safari that's causing this here: https://bugs.webkit.org/show_bug.cgi?id=172051

This was referenced May 12, 2017
@KZeni KZeni changed the title blob: video URLs/sources don't open Safari's PiP (this includes new YouTube, Vimeo, and others!) blob: video URLs/sources don't open Safari's PiP (this includes new YouTube, Vimeo, Twitch, Netflix, and others!) May 12, 2017
@KZeni
Copy link
Author

KZeni commented May 12, 2017

From my newer comments on the Safari bug tracker:

It appears that using document.getElementsByTagName('video')[0].webkitSetPresentationMode('inline'); works on a YouTube video (if you were to make it a PiP via the video element's context menu) whereas document.getElementsByTagName('video')[0].webkitSetPresentationMode('picture-in-picture'); does not work (even if you execute this immediately after the inline command worked.)

Finally, it appears that the use of a javascript:document.getElementsByTagName('video')[0].webkitSetPresentationMode('picture-in-picture'); bookmarklet does work while running document.getElementsByTagName('video')[0].webkitSetPresentationMode('picture-in-picture'); directly from Safari's console does not.

Oddly enough, the use of document.getElementsByTagName('video')[0].webkitSetPresentationMode('picture-in-picture'); directly in the console starts working after you have used the javascript:document.getElementsByTagName('video')[0].webkitSetPresentationMode('picture-in-picture'); bookmarklet.

Triggering a PiP shouldn't require a bookmarklet or using the context menu of the video element while using the webkitSetPresentationMode('picture-in-picture'); command directly via the browser's JavaScript (be it an extension or via the browser's console) does not work.

@KZeni
Copy link
Author

KZeni commented May 12, 2017

Also, it appears this issue isn't just restricted to blob: video sources (I just thought that since that was being used on every site I tested up to this point).

Potential fix for now:

I wonder if making this extension trigger itself as if it were a bookmarklet would be the overall fix until Safari changes this behavior.

@KZeni KZeni changed the title blob: video URLs/sources don't open Safari's PiP (this includes new YouTube, Vimeo, Twitch, Netflix, and others!) Many video sources aren't opening Safari's PiP now (this includes new YouTube, Vimeo, Twitch, Netflix, and others!) May 12, 2017
@arnoappenzeller
Copy link
Owner

Hmm not sure how this will affect the final versions of Safari but I will definitely look into this when the new macOS beta is out.

But thank you for filing this odd behaviour
(To be honest I haven't used the latest technology preview yet)

@AbbyJanke
Copy link

Any update on this? Seems alot of sources aren't working anymore :/

@kaishin
Copy link

kaishin commented Jul 18, 2017

Noticed the same thing as well with blob: videos.

@kaishin
Copy link

kaishin commented Jul 18, 2017

@arnoappenzeller Checked on High Sierra and it's exactly the same issue.

@arnoappenzeller
Copy link
Owner

Can you try to disable the setting for pip button on popular sites and observe if it is still the same?
You can still use the PiP button in the Safari toolbar.

As I said I can’t reproduce this atm.
My guess is it that something crashes when PiPifier tries to insert the button to those videos players... maybe it’s also memory related 🤔

@bgbruno
Copy link

bgbruno commented Jul 26, 2017

Just let you know FACEBOOK works like a charm. Thank you.

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

5 participants