hoyois / clicktoplugin

Prevents plug-ins from loading automatically in Safari
http://hoyois.github.com/safariextensions/clicktoplugin/
229 stars 43 forks source link

Full screen not working for youtube videos in Google Plus #48

Closed lidow closed 10 years ago

lidow commented 10 years ago

When I try to switch to full-screen a youtube video shared on Google+, then the whole site just goes fullscreen. A workaround is to open the video in youtube site first then FS is working ok.

hoyois commented 10 years ago

That sounds like a bug in Safari. Can you link to a public example?

lidow commented 10 years ago

This is visible only on G+, and you should have a Google account to use it. Strange is that if I copy link to concrete post and open it in new tab it works correctly. Problem is visible only if you are in your G+ account and click an embedded clip from there.

hoyois commented 10 years ago

OK, so this happens when you click on the "fullscreen" button in the video controls, or when you use a keyboard shortcut, or both?

lidow commented 10 years ago

This happens when I click the button. I don't know and don't use the keyboard shortcut.

hoyois commented 10 years ago

Ah well, this is a bug internal to Safari then (unless G+ is programmed to go fullscreen when you click that spot, but that seems unlikely). Maybe it's already fixed though: what's your Safari version?

JohnBlackburne commented 10 years ago

I think it's G+ doing something odd. I can reproduce this in Safari (latest version, latest Mac OS). But if I disable Javascript after the page has loaded the video goes full screen as expected. No idea how or why it's doing what it does, my JS skills don't run to debugging it.

hoyois commented 10 years ago

What happens if you press F to go fullscreen instead of clicking the button? When you click the button, you're not using the extension at all: the click is processed internally by Safari so you're not even using Javascript. But when you press F the extension calls enterFullscreen on the video element, so maybe that works normally, unless Safari is completely confused in its handling of fullscreen mode on G+ pages.

lidow commented 10 years ago

I just try it, same behaviour - the whole page goes FS.

I suspect there is a JavaScript on click event for the < video > tag, that is propagated up to parent elements where a listen handler catch it. Maybe a "stopPropagation" and/or "preventDefault" could prevent this to happens.

lidow commented 10 years ago

Here are some resources on the subject:

http://www.thecssninja.com/javascript/fullscreen

hoyois commented 10 years ago

I suspect there is a JavaScript on click event for the < video > tag, that is propagated up to parent elements where a listen handler catch it. Maybe a "stopPropagation" and/or "preventDefault" could prevent this to happens.

This cannot be the explanation, since when you press F the enterFullscreen method of the video element is called. It's the same as selecting the video element and entering

$0.webkitEnterFullscreen()

in the console. This method is not even part of the fullscreen API, although it probably relies on the same code internally, and there must be a mixup somewhere in there. The only thing you can do is report this at http://bugs.webkit.org.

MarkBTomlinson commented 10 years ago

It happens in Chrome so not a Safari issue and it never used to happen.