Disappearing YouTube videos (and other embedded content)

Posted by jw285 at Oct 14, 2013 01:48 PM |
We’ve been getting some reports recently that YouTube videos (and other kinds of content that you can embed into webpages) are disappearing, even though the Plone page hasn’t been updated recently.

The reason for this is that the embedded content is being blocked by the web browser. To understand why, you have to know the difference between secure and non-secure content on the web.

Secure vs non-secure content

Content that is delivered securely (i.e. is encrypted) has a web address starting with https.

Content that is delivered non-securely (i.e. isn’t encrypted) has a web address starting with http (notice it doesn’t have an s).

When you’re logged into Plone the pages are always delivered securely (https). When you’re not logged into Plone the pages can be viewed both securely (https) and non-securely (http).

So why do videos (and other stuff) get blocked?

When a page is delivered securely but contains embedded content, such as a YouTube video, which is delivered non-securely your web browser might consider the non-secure content a potential risk and block it for security reasons. Some browsers give you an obvious warning message when this happens and allow you to show the non-secure content. Other browsers don’t and block the non-secure content without any warning.

This is the message that you get at the bottom of the page in Internet Explorer 9, the University's default web browser.

IE9 warning message

What can I do to stop things from being blocked by the browser?

If a webpage is delivered securely you need to make sure that the embedded content is also being delivered securely.

These days when you embed a YouTube video the embed code that you get from YouTube won’t even contain a protocol. Notice that the example below contains a web address beginning with two forward slashes (//) and misses the protocol (http or https) off completely.

<iframe width="560" height="315" src="//www.youtube.com/embed/71X3DlTtRVM?list=PLDB0A3A2BD781C1E5" frameborder="0" allowfullscreen></iframe>

This means that the video will be delivered using whatever protocol the webpage is using, either secure or non-secure. Problem solved!

In most cases you’ll just be able to remove the http part of the web address and embedded content will not get blocked. However if this doesn’t work for you then please let us know.

About Me - Jeff Wilkinson

Share this page: