Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm running a site that only communicates over SSL/https so if I embed a youtube video using http I will get an error message saying the site is'nt fully secure. Is it possible to rewrite something so that WordPress accepts https and still auto embeds youtube links added to the content area? Cause now, when I try to embed a https youtube link, all that is shown is the URL, no movie.

Update

I've tried to add providers using this code in functions.php but it does nothing:

wp_oembed_add_provider('https://youtu.be/*', 'https://youtube.com/oembed' );
wp_oembed_add_provider('#https://(www\.)?youtube.com/watch.*#i', 'https://youtube.com/oembed', true);
wp_oembed_add_provider('http://youtu.be/*', 'https://youtube.com/oembed' );
wp_oembed_add_provider('#http://(www\.)?youtube.com/watch.*#i', 'https://youtube.com/oembed', true);
share|improve this question
1  
Ok, it's in the Wordpress Trac: core.trac.wordpress.org/ticket/18719 – Richard B Feb 1 '12 at 10:01
There seems to be a way around it but I don't know exactly how to implement this solution in WordPress, would like some help: groups.google.com/group/youtube-api-gdata/browse_thread/thread/… – Richard B Feb 1 '12 at 13:21

2 Answers

up vote 4 down vote accepted

http://core.trac.wordpress.org/ticket/18719 has a working patch now.

Edit: Plugin code to do similar until patch gets in:

wp_oembed_add_provider('#https://(www\.)?youtube.com/watch.*#i', 'http://youtube.com/oembed?scheme=https', true);
wp_oembed_add_provider('https://youtu.be/*', 'http://youtube.com/oembed?scheme=https', false );
share|improve this answer
Yes, I've commented in that trac ticket as well. Thanks! – Richard B Feb 6 '12 at 20:07

Youtube supports https urls for videos (just add the "s" into the regular url). However, they also state that:

In particular, only the YouTube player code is accessible via HTTPS at this time. The actual video bitstream, and some additional content loaded by the YouTube player may still be accessed via standard HTTP connections when you use an HTTPS URL in your embed code.

So it looks like you won't be able to get https video feeds just yet. This appears to be confirmed by the trac link you posted: (Comment 7 by Otto42) "Until YouTube returns https results in the iframe, embedding such a link would just result in a broken page in most browsers, since the iframe isn't SSL."

Reference: http://apiblog.youtube.com/2011/02/https-support-for-youtube-embeds.html

You might also check out this solution: http://www.adammershon.com/display-youtube-videos-on-ssl-page/ (This would essentially "serve" the video as if it were on your page.)

(I don't see anything newer about the subject.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.