Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Version 3.5.2 youtube fullscreen not available in chrome #2132

Closed
jackpi2018 opened this issue Nov 22, 2018 · 11 comments
Closed

Version 3.5.2 youtube fullscreen not available in chrome #2132

jackpi2018 opened this issue Nov 22, 2018 · 11 comments

Comments

@jackpi2018
Copy link

jackpi2018 commented Nov 22, 2018

Hi. i have an issue about the fancybox in version 3.5.2. Youtube fullscreen button not available when browsing in Chrome. (but in Firefox, Edge, IE it works). It works in the fancybox demo page (https://fancyapps.com/fancybox/3/).
However when i do it locally it cannot work.
I have tried the older version which is 3.4.1 it works locally in Chrome. After version 3.4.2 it start not working in Chrome.

@fancyapps
Copy link
Owner

Hi,

Do not test video/iframes/ajax locally, you have to use web server to get full functionality due to browser security policies.

@jackpi2018
Copy link
Author

jackpi2018 commented Nov 23, 2018

Hi I have try it on the web server but it has the same issue at chrome as well.
Below is the code I test in the web server. Anything I miss out?
insert fancybox css in head
link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.2/jquery.fancybox.min.css"

`

<title>Test Fancy Box</title>
<a href="https://source.unsplash.com/IvfoDk30JnI/1500x1000" data-fancybox="ty" data-caption="&lt;b&gt;Single photo&lt;/b&gt;&lt;br /&gt;Caption can contain &lt;em&gt;any&lt;/em&gt; HTML elements">
    <img src="https://source.unsplash.com/IvfoDk30JnI/240x160" />
</a>

<a href="https://source.unsplash.com/0JYgd2QuMfw/1500x1000" data-fancybox="ty" data-caption="This image has a simple caption">
    <img src="https://source.unsplash.com/0JYgd2QuMfw/240x160" />
</a>

<a href="https://source.unsplash.com/xAgvgQpYsf4/1500x1000" data-fancybox="ty">
    <img src="https://source.unsplash.com/xAgvgQpYsf4/240x160" />
</a>
<a data-fancybox="ty" href="https://www.youtube.com/watch?v=_sI_Ps7JSEk">
    <img class="card-img-top img-fluid" src="http://img.youtube.com/vi/_sI_Ps7JSEk/mqdefault.jpg" />
</a>
</p>

<!-- JS -->
<script src="//code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.2/jquery.fancybox.min.js"></script>
`

@fancyapps
Copy link
Owner

After some experimenting, I discovered that Google has recently made some changes (they are quite famous about their privacy policies) and now they do not allow full-screen for embeds that are using src="//www.youtube.com... or src="//www.youtube-nocookie.com.... I think this is because they are now forcing https for youtube and the web (https://developers.google.com/web/updates/2016/10/avoid-not-secure-warn).

So, changing embeds to src="https://www.youtube.com seems to fix this issue and this will be included in the next update. Thanks for bringing this up.

@jackpi2018
Copy link
Author

jackpi2018 commented Nov 26, 2018

ok thank you. may i know any alternative solution for current latest version(3.5.2)?

@fancyapps
Copy link
Owner

Try setting

$.fancybox.defaults.media.youtube = { url : 'https://www.youtube-nocookie.com/embed/$4' };

@jackpi2018
Copy link
Author

jackpi2018 commented Nov 26, 2018

Sorry may i ask where should i put this command? is this a global functions apply to all videos?

@fancyapps
Copy link
Owner

  1. Anywhere (obviously, not on chair or floor, but on your page or external js file, it depends on how you organize your code);
  2. Yes, because this snippet just changes defaults for template used to create video embed code.

@jackpi2018
Copy link
Author

ok. thank you so much. it works.

fancyapps added a commit that referenced this issue Dec 10, 2018
- Fixed #2122 - Focusable HTML5 video
- Fixed #2128 - Missing smallBtn on mobile
- Fixed #2096 - autoStart fullscreen AND slideshow
- Fixed #2097 - German translation
- Fixed #2132 - Youtube fullscreen

- Captions now have linear-gradient background (instead of background image for pseudo element) and can have max-height and vertical scrollbar
- Improved design for phones having the notch (https://webkit.org/blog/7929/designing-websites-for-iphone-x/)
@ozgunmustafa
Copy link

$.fancybox.defaults.media.youtube = { url : 'https://www.youtube-nocookie.com/embed/pCZqcp-jZhw' };
this code not working. I see this message " Video unavaliable"

@fancyapps
Copy link
Owner

fancyapps commented Apr 7, 2021 via email

@acwolff
Copy link

acwolff commented Apr 7, 2021

On my website the full screen button works fine with Chrome, as you can see here:
https://www.andrewolff.nl/FotoSerie/Algarve/Videos/index.html

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

No branches or pull requests

4 participants