WordPress.org

Plugin Directory

WP YouTube Lyte

High performance YouTube video, playlist and audio-only embeds which don't slow down your blog and offer optimal accessibility.

Why does WP YouTube Lyte need to access the YouTube API? What is an API anyway?

An API is a way to have two pieces of software talk to each other to exchange information. In this case WP YouTube Lyte contacts YouTube to ask it for the thumbnail, the title and the description of the video you added. The thumbnail and title are visible on the webpage (in the Lyte player) while the description is in the HTML as microdata for search engines optimization reasons (see below).

What is an API key and why does WP YouTube Lyte need one all of a sudden?

Up until WP YouTube Lyte 1.5.0 the v2 YouTube API was used, but in September 2014 Google announced it was going to decommission that version, forcing the switch to v3. A big difference between v2 and v3 is that, whereas v2 allowed "anonymous" requests, this is not the case for v3 any more. This means any request to the YouTube API v3 has to be identified with a key (a string with seamingly random letters & numbers). You can get such a key from Google for free (see below) and you have to enter that in WP YouTube Lyte's settings page.

OK, now how can get that API key?

  1. Go to Google Developer Console and log in with your Google account.
  2. Click on 'Create Project' and:

    • Fill in a Project Name
    • Fill in a Project ID
    • Click on 'Create'
  3. On the next page (or when there is no next page, click on your Project's name):

    • Click on 'Enable an API'
    • Scroll down to YouTube Data API v3 and click on it
    • Click on 'OFF' at the top to enable the API
    • Optionally disable other API's
  4. In the sidebar on the left:

    • Click on 'Credentials'
    • Click on 'Create new Key'
    • Click on 'Server Key'
    • Leave the box with whitelisted IP's empty
    • Click on 'Create'
  5. Copy your API key to WP YouTube Lyte settings page.

Will WP YouTube Lyte work if I don't provide an API key?

Yes, with some exceptions; WP YouTube Lyte will continue to work, rendering Lyte players, but without the title and microdata (description, time, ...) and without thumbnails for playlists.

I don't want an API key, how can I get rid of the "API key"-notice?

Just enter "none" (without the quotes) in the API key field and Lyte will stop nagging you.

What does "html5 video support" mean?

When playing, HTML5 video will not be visible for everyone (see requirements). Indeed some visitors will see the fallback Flash video instead.

What are the requirements to see embedded YouTube HTML5 video?

  • Beginning 2015 YouTube announced it would switch to HTML5 video by default.
  • This will work in browsers that support the h264 or WebM video codecs, most modern browser should work.
  • Browsers that don't support those codecs will, upon playing, fall back to Flash.

Does WP YouTube Lyte protect my visitor's privacy?

As opposed to some of the most important plugins there is no 3rd party tracking code in WP YouTube Lyte, but YouTube off course does see visitor requests coming in (see also the youtube-nocookie.com remark in Bugs/Issues below) for the thumbnails.

Can I use WP YouTube Lyte for a custom field?

Just pass the httpv url of such a field to lyte_preparse like this:

if(function_exists('lyte_preparse')) { echo lyte_preparse($video); }

and you're good to go!

Does WP YouTube Lyte work with Infinite Scroll?

Starting from version 1.1.0 it does; in Infinite Scroll's configuration you just have to add "ly.te()" in the "Javascript to be called after the next posts are fetched"-box.

Can I still integrate with YouTube's JS API?

This was added as a beta feature in version 1.1.0; add ?enablejsapi=1 to the httpv URL. WP YouTube Lyte will pick this up, and add ?enablejsapi=1&origin= to the URL of the iFrame with the iFrame id being set to iF_. As soon as your visitors plays the video, you should be able to hook up with the video.

How does WP YouTube Lyte support microdata?

  • There is a specific microdata scheme for "videoObject" which WP YouTube Lyte can add to your page, which Google can use to display the video thumbnail next to the search-result
  • This is optional and can be disabled in the options page
  • The videoobject microdata is NOT added for audio-only embeds, playlists or widgets
  • Google will not always display the thumbnail, this presumably depends of the relevance of the video to the rest of the page.

How does captions-support get added to the microdata?

In January 2014 Benetech, a U.S. nonprofit that develops and uses technology to create positive social change, offered a patch that adds the accessibilityFeature property to the microdata for videos that have captions. If you have microdata enabled, WP YouTube Lyte will automatically try to check (in a seperate, asynchronous call via a proxy-webservice, as YouTube only offers captions in their API v3 which requires authentication) if captions are available and if so, adds the accessibilityFeature property with value captions to the microdata. This can be disabled by either disabling microdata or, if you want microdata but not the accessibilityFeature-property by using the "lyte_docaptions"-filter to set captions to false (example-code is in lyte_helper.php_example).

Responsive LYTE embeds

  • The video width in posts and pages will adapt to the width of the container (the div) in which your blogposts/ pages are shown. This means that if your theme is responsive, WP YouTube Lyte will follow.
  • Widgets are not responsive.
  • if the content div width gets to around 200 pixels, the LYTE UI will become garbled (YouTube requires the minimum embed width to be 200px as well).

Can I use WP YouTube Lyte on normal YouTube links?

Yes, starting with version 1.5.0 normal YouTube links are automatically transferred in Lyte embeds as well. You will automagically also get a (non-Lyte) preview of the video in your visual post edit screen.

What can I do with the API?

A whole lot; there are filters to pre-parse the_content, to change settings, to change the CSS, to change the HTML of the LYTE-div, ... There are examples for all filters (and one action) in lyte_helper.php_example

How can I use/ activate lyte_helper.php_example?

Copy it to /wp-content/plugins/lyte_helper.php and activate it in WordPress' plugin page. After that you can simple remove the one of the comment-sequences (double-slash) to activate one (or more) of the functions in there.

Problem with All In One Seo Pack

All in One SEO Pack be default generates a description which still has httpv-links in it. To remove those, you'll have to use (example code in) lyte_helper.php (see above) and add lyte_filter_aioseop_description to the aioseop-filter in there.

When I click on a LYTE video, a link to YouTube opens, what's up with that?

You probably added a link around the httpv-url. No link is needed, just the httpv-url.

Any bugs/ issues should I know about?

  • Although the widget is available in (very) small sizes, these do not display that great and might, in the near future, be disabled by YouTube as their Terms of Service state that the smallest available embedded player is 200X200 pixels. Use the deprecated smaller sizes at your own risk.
  • Having the same YouTube-video on one page can cause WP YouTube Lyte to malfunction (as the YouTube id is used as the div's id in the DOM, and DOM id's are supposed to be unique)
  • When using the Firefox plugin Karma Blocker, the video isn't visible when clicking "play", with a warning message being shown instead. This is expected behavior and should be solved by tweaking Karma Blocker's configuration.
  • The translations have not been updated entirely for version 1.2.0 and later. Help with translations is high on my wish-list, contact me if you are interested to help!

I found a bug/ I would like a feature to be added!

Just tell me, I like the feedback! Use the Contact-page on my blog, leave a comment in a post about wp-youtube-lyte or create a new topic on the wordpress.org forum.

How you can help

Requires: 2.9 or higher
Compatible up to: 4.3
Last Updated: 2015-8-19
Active Installs: 10,000+

Ratings

4.9 out of 5 stars

Support

4 of 6 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

1 person says it works.
0 people say it's broken.

100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 50,2,1 100,1,1
100,1,1
100,1,1 100,1,1 100,1,1
100,1,1 100,3,3
100,1,1 100,1,1
0,1,0 100,2,2 100,5,5
100,3,3 100,1,1 100,1,1 100,2,2
100,1,1
100,2,2
100,1,1 100,1,1 50,2,1 100,1,1 100,1,1 100,3,3 100,2,2 100,1,1 0,1,0 0,1,0
100,1,1 100,3,3 100,1,1
100,2,2 100,2,2 100,3,3 100,3,3 100,2,2 100,1,1
80,5,4 67,3,2 100,1,1
50,2,1
75,4,3 0,1,0 75,4,3
100,3,3 100,1,1 100,3,3
100,1,1
100,1,1 100,2,2 100,3,3 100,2,2
100,1,1 100,1,1
100,1,1 100,1,1 100,1,1
100,1,1 100,1,1
100,1,1
100,1,1 67,3,2 100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,2,2
100,2,2 100,3,3
100,2,2
100,1,1 100,1,1 100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1 100,1,1
100,1,1