• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How To Force SSL in YouTube Vids?

DRE

Well-known member
#1
Tried this, didn't work.

I run site-wide SSL on my small private forum. No real issues and I redirect http to https. The BB Code Media Sites settings are the only things I had to change.

I edited the BB Code for each media site from http to httpS in each the site URL and the iframe. It seems to work fine, and threads that contain media links keep the ssl-lock-icon when just viewing the thread. If you play one of the embedded videos, each Chrome and Firefox drop the lock icon because the bitstream data itself is delivered via http even though it was requested from an https URL(details below). But as soon as I navigate away from the thread where I watched the video back to the index or any other thread, the lock icon returns and everything works fine.

Here's the statement from the YT API blog about it. -


After a little more research, I found a workaround for this minor annoyance via an .htaccess re-write, as is described here. But I haven't gotten around to trying it yet.

It seems as though there is a very limited number of XF sites using https. It'll be interesting to see if there are more in the future.
I run site-wide SSL on my small private forum. No real issues and I redirect http to https. The BB Code Media Sites settings are the only things I had to change.

I edited the BB Code for each media site from http to httpS in each the site URL and the iframe. It seems to work fine, and threads that contain media links keep the ssl-lock-icon when just viewing the thread. If you play one of the embedded videos, each Chrome and Firefox drop the lock icon because the bitstream data itself is delivered via http even though it was requested from an https URL(details below). But as soon as I navigate away from the thread where I watched the video back to the index or any other thread, the lock icon returns and everything works fine.

Here's the statement from the YT API blog about it. -


After a little more research, I found a workaround for this minor annoyance via an .htaccess re-write, as is described here. But I haven't gotten around to trying it yet.

It seems as though there is a very limited number of XF sites using https. It'll be interesting to see if there are more in the future.
 

RoldanLT

Well-known member
#2
  • /admin.php?bb-code-media-sites/youtube/edit
  • Embed HTML
Change this entire code from:
Code:
<iframe width="500" height="300" src="http://www.youtube.com/embed/{$id}?wmode=opaque&autoplay=1" frameborder="0" allowfullscreen></iframe>
to
Code:
<iframe width="500" height="300" src="https://www.youtube.com/embed/{$id}?wmode=opaque&autoplay=1" frameborder="0" allowfullscreen></iframe>
or
Code:
<iframe width="500" height="300" src="//www.youtube.com/embed/{$id}?wmode=opaque&autoplay=1" frameborder="0" allowfullscreen></iframe>
 

digitalpoint

Well-known member
#4
What do you have in your "Embed HTML" field for YouTube in the BB Code Media Sites area of the XF admin?

Definitely works fine for me under SSL.
 

DRE

Well-known member
#5
  • /admin.php?bb-code-media-sites/youtube/edit
  • Embed HTML
Change this entire code from:
Code:
<iframe width="500" height="300" src="http://www.youtube.com/embed/{$id}?wmode=opaque&autoplay=1" frameborder="0" allowfullscreen></iframe>
to
Code:
<iframe width="500" height="300" src="https://www.youtube.com/embed/{$id}?wmode=opaque&autoplay=1" frameborder="0" allowfullscreen></iframe>
or
Code:
<iframe width="500" height="300" src="//www.youtube.com/embed/{$id}?wmode=opaque&autoplay=1" frameborder="0" allowfullscreen></iframe>
Did that earlier before making this thread, didn't work.
 

DRE

Well-known member
#6
What do you have in your "Embed HTML" field for YouTube in the BB Code Media Sites area of the XF admin?

Definitely works fine for me under SSL.
HTML
Code:
<iframe width="500" height="300" src="https://www.youtube.com/embed/{$id}?wmode=opaque" frameborder="0" allowfullscreen></iframe>
Match URLS
Code:
youtube.com/watch?v={$id}
youtube.com/v/{$id}
youtu.be/{$id}
youtube.com/watch?feature=player_embedded&v={$id}
 

digitalpoint

Well-known member
#7
This is what I use... try it just to test it...

Code:
<iframe src="//www.youtube.com/embed/{$id}?html5=1" width="500" height="300" frameborder="0" allowfullscreen=""></iframe>
Not specifying the protocol will just use whatever protocol the site is using automatically. Also, I have mine display as HTML5 when possible because Flash sucks.
 

DRE

Well-known member
#8
This is what I use... try it just to test it...

Code:
<iframe src="//www.youtube.com/embed/{$id}?html5=1" width="500" height="300" frameborder="0" allowfullscreen=""></iframe>
Not specifying the protocol will just use whatever protocol the site is using automatically. Also, I have mine display as HTML5 when possible because Flash sucks.
This worked! Thank you!
 

DRE

Well-known member
#9
So that src="// can be applied to the other bb codes? what about html5=1 is that something that is also applied to other video bb codes?
 

SamL

Active member
#12
Did that earlier before making this thread, didn't work.
The info from the first post works perfectly fine on my SSL site. I'm not running the XenMedio addon that you linked though. I wonder if that's why the edit suggestions from the first couple of posts didn't work for you.
 
Last edited:

digitalpoint

Well-known member
#16
Just tested it on my site... no issues with the overlay. Maybe because I force the HTML5 version rather than Flash or something... not sure. I suspect users would complain if it was an issue for certain browsers.
 

HWS

Well-known member
#17
wmode is a setting for flash only. It specifies how the hidden background of the video will be. Due to a bug old IE browsers do not render any z-index correctly if wmode=opaque has not been set.
 
Last edited: