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

Browser complains about mixed content on sites using SSL #156

Open
WileESpaghetti opened this issue Aug 20, 2015 · 7 comments
Open

Browser complains about mixed content on sites using SSL #156

WileESpaghetti opened this issue Aug 20, 2015 · 7 comments

Comments

@WileESpaghetti
Copy link

If a site is loaded using https:// youtube videos (and probably other embeds) will not load because the script hard codes http in the video URLs

Here's the error from the chrome web inspector:

Mixed Content: The page at 'https://$DOMAIN/' was loaded over HTTPS, but requested an insecure resource 'http://www.youtube.com/embed/$VIDEO_ID?rel=0&autoplay=1'. This request has been blocked; the content must be served over HTTPS.

darylteo added a commit to darylteo/prettyphoto that referenced this issue Oct 15, 2015
If a site is loaded using https:// youtube videos (and probably
other embeds) will not load because the script hard codes http
in the video URLs

The following fix is as follows:

 - only applies to video urls (any impact on other embeds unknown)
 - checks for the current document protocol (http: or https:)
 - if protocol is file:, then it defaults to
   - http for youtube as it is existing behaviour
   - specified protocol in the vimeo url (new behaviour)

See this fix in action at by clicking the vimeo videos on the
right.

https://www.listcorp.com/asx/ler
darylteo added a commit to darylteo/prettyphoto that referenced this issue Oct 15, 2015
If a site is loaded using https:// youtube videos (and probably
other embeds) will not load because the script hard codes http
in the video URLs

The following fix is as follows:

 - only applies to video urls (any impact on other embeds unknown)
 - checks for the current document protocol (http: or https:)
 - if protocol is file:, then it defaults to
   - http for youtube as it is existing behaviour
   - specified protocol in the vimeo url (new behaviour)

See this fix in action at by clicking the vimeo videos on the
right.

https://www.listcorp.com/asx/ler
darylteo added a commit to darylteo/prettyphoto that referenced this issue Oct 15, 2015
If a site is loaded using https:// youtube videos (and probably
other embeds) will not load because the script hard codes http
in the video URLs

The following fix is as follows:

 - only applies to video urls (any impact on other embeds unknown)
 - checks for the current document protocol (http: or https:)
 - if protocol is file:, then it defaults to http: as is
   existing behaviour

See this fix in action at by clicking the vimeo videos on the
right.

https://www.listcorp.com/asx/ler
okcoker added a commit to okcoker/prettyphoto that referenced this issue Jan 14, 2016
@Patabugen
Copy link

With TLS sites becoming more popular this is going to cause more issues.

@vikkilea
Copy link

vikkilea commented Jul 4, 2017

Currently having this issue. Please merge!

@MageNext
Copy link

MageNext commented Jul 25, 2017

I solved the problem by fixing the lines:

http://player.vimeo.com/video/"+i[3]+"?title=0&byline=0&portrait=0",settings.autoplay&&(movie+="&autoplay=1;"),

to

https://player.vimeo.com/video/"+i[3]+"?title=0&byline=0&portrait=0",settings.autoplay&&(movie+="&autoplay=1;"),

I gotta do it to every single site with prettyphoto & vimeo though...

@asadmalik
Copy link

@MageNext which file did you edited?
Thanks

@evilprogrammerng
Copy link

Edit PrettyPhoto.js

Replace every "http://" with "//" if you find any
Replace every "https://" with "//" if you find any

This will make pretty use same protocol with the browser, ssl or not.

@iSWORD
Copy link

iSWORD commented Dec 12, 2018

is this project dead? why is this still not solved?

@bloggr
Copy link

bloggr commented Apr 23, 2019

``Youtube In Pretty Photo

After having scoured the entire web & every forum regarding the issue with PrettyPhoto not displaying Youtube or Vimeo video's - I have stumbled upon an alternative method of getting both to display.

The solution is to implement video ( media content ) via the iFrame solution.

As depicted above, simply pass the video as : https://www.youtube.com/embed/h3aVkc5MbDE?iframe=true&width=100%&height=100%
and then use : rel="prettyPhoto[iframe]

You can use an image ( like the example above ) or simple text

WITH IMAGE :

<a href="https://www.youtube.com/embed/h3aVkc5MbDE?iframe=true&width=100%&height=100%" rel="prettyPhoto[iframe]" title="Click To View Video"><img src="https://static.toiimg.com/thumb/msid-64590538,width-640,resizemode-4/64590538.jpg" width="640" height="390" alt="Youtube In Pretty Photo"/></a>

WITH TEXT :

<a href="https://www.youtube.com/embed/h3aVkc5MbDE?iframe=true&width=100%&height=100%" rel="prettyPhoto[iframe]" title="Click To View Video">Your PrettyPhoto Video</a>

`NOTE : If you want, you could include/show as many videos as you wish by simply changing the rel="prettyPhoto[iframe] to plural rel="prettyPhoto[iframes] - and just add the amount of vids you want below each iFrame.

Hope this will help anyone who may still be searching for the solution to this problem with PrettyPhoto

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

8 participants