WordPress.org

Plugin Directory

YouTube Embed

A simple to use method of embedding YouTube videos into your posts and pages but with powerful features for those that need them.

How do I find the ID of a YouTube video?

If you play a YouTube video, look at the URL - it will probably look something like this - http://www.youtube.com/watch?v=L5Y4qzc_JTg.

The video ID is the list of letters and numbers after v=, in this case L5Y4qzc_JTg.

When trying to display a video it says "An error occurred accessing the YouTube API"

This has been reported by a number of users - for some reason some people are unable to access the YouTube API, which is used by this plugin to determine the video type and whether it's valid or not. If you are one of them then simply go to the Options screen within the YouTube Embed administration menu and, near the bottom, there is an option to stop reporting API errors.

If you switch off API errors then the plugin will simply assume all IDs are valid and work out the type from the ID length (which is not set, so if this changes in future it may cause problems!).

I have requested further information on why these errors may be occurring from the YouTube forum but, as yet, I've had no response. Click here if you wish to track the request.

So if I upgrade to this from an earlier version is it compatible?

It should be, yes, but with one exception.

If you have upgraded from version 2.0.1 or before and used the style parameter then it may cause some problems. This is because the style parameter now affects the CSS of the video. Before, it added a DIV "wrapper" around the video and applied the styles to this.

Therefore, if you used the style parameter to centre a video this probably doesn't now work. However, you can do this now by using the template parameter instead - please read the section on that for further help.

However, with the change to the way the style works you can now apply more direct styling to the video - e.g. adding a border.

Is the generated code standards compliant?

In all cases, yes. However, it depends on which options you choose as to which DOCTYPE it will validate to.

IFRAME does not work with XHTML so will only validate as XHTML transitional (this includes if you use IFRAME as the fallback to EmbedPlus).

If you include Metadata then you must use the XHTML Strict + RDFa DOCTYPE - in this case it validates.

If you don't include Metadata then it will also validate as HTML5 compliant.

The W3C Markup Validation Service was used to test the above.

You can read more about this here.

Which browsers does the output work on?

It uses standard OBJECT and IFRAME coding - this, along with the above standards compliance, means that the output should work on most browsers.

The video output is overlapping or stuttering

If you go into the Profile screen in Administration there is a "Window Mode" option. This defines how Flash output interacts with any other around it. "Window" is the default and gives good performance but may cause overlapping. If overlapping is causing an issue try "Opaque".

No video is showing

If you find no video is showing but there's no error either check the source code of the page. Can you find the text "" in the page? If so, you have Jetpack installed and that is displaying the video instead.

There are two ways around this.

First, you could disable all the shortcodes in Jetpack - Jetpack allows you to deactivate certain "modules" of the plugin and, if you can live without the other extra shortcodes, deactivating the shortcodes part will restore functionality back to YouTube Embed

Alternatively, you can use a secondary shortcode - [youtube_video]. Use this instead of [youtube ] and YouTube Embed will render the results without a problem

This second suggestion will work for any plugin that may use the same shortcode.

There used to be an option to allow the plugin to work with YouTube URLs. Where did it go?

WordPress will, by default, convert YouTube URLs to videos using a very basic default configuration. Earlier versions of this plugin had an option to override this so this plugin would output the results instead (giving you full control of the output). Unfortunately, it stopped working and I do not have enough knowledge on the required WordPress code to work out how to fix it. Rather than leave broken code in place I have removed it.

If you wish to have full control over your YouTube output I would suggest placing all YouTube URLs within [youtube ] shortcodes.

My OPTIONS table seems to be full of cache entries for YouTube Embed

Due to a housekeeping limitation in WordPress cache entries, which are stored in the OPTIONS table, may get left behind. There are 2 solutions to clearing this.

First of all, in the Options menu in YouTube Embed administration, there is an option in the performance section named "Clear Cache". Simply tick this box and click on the "Save Settings" button to clear out any cache.

However, the best option is to install the plugin Artiss Transient Cleaner, which will housekeep the OPTIONS table automatically.

Is this plugin compatible with Turn Off The Lights?

If you display the video responsively then it doesn't work with Turn Off The Lights. Switch this option off and it will.

I've raised this with the developer of Turn Off The Lights and he is going to implement a change in the future to improve compatibility with responsive video.

I get the message "Blocked plug-in" in Safari

Your version of Flash is out-of-date and needs updating.

The "autostart" feature is not working in iOS

Unfortunately, this is a restriction that has been put in place by Apple.

I cannot get the video to start at a specific point in iOS

This is a known issue with the YouTube player and is with Google to fix.

I can't get the video to play at a specific resolution by default

There is no way to specify this - YouTube makes the decision on which version to play depending on a number of factors. The old version of their player had an "HD" option but that too didn't guarantee HD playback.

I have another issue or a request

Before reporting it please bear in mind that this plugin uses the standard YouTube API. Adding extra functionality to the player itself is not possible and there are known issues with it. I would also recommend performing a Google search for your issue too first, as this will often resolve a lot of queries.

Which version of PHP does this plugin work with?

It has been syntax checked as PHP 4. However, this does not guarantee PHP 4 compatibility and the minimum for WordPress is now PHP 5.2.4.

Although I attempt to keep with PHP 4 compatibility there are no guarantees of this.

Requires: 3.9 or higher
Compatible up to: 4.1.1
Last Updated: 2015-3-30
Active Installs: 40,000+

Ratings

3.8 out of 5 stars

Support

1 of 5 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

2 people say it works.
0 people say it's broken.

100,3,3
100,1,1
100,1,1
100,1,1
0,1,0
100,1,1
75,4,3 100,2,2
83,6,5
100,1,1
100,1,1 100,1,1 100,1,1 100,3,3 55,11,6 100,2,2 100,4,4
100,2,2
100,3,3 100,3,3 100,5,5
100,1,1 100,2,2 100,1,1 100,1,1 100,2,2 60,5,3
0,2,0 100,1,1
0,1,0 100,1,1 100,4,4 100,1,1
50,2,1 100,1,1 100,3,3 100,3,3 100,1,1 100,1,1
100,2,2 100,1,1 100,2,2 100,1,1
83,6,5
100,1,1
100,1,1
100,2,2 100,1,1
100,1,1
100,1,1 100,2,2