Category Archives: wp-youtube-lyte

WP YouTube Lyte 1.4.0; support for accessibilityFeature

A new version of WP YouTube Lyte was released over the weekend. Benetech, a U.S. nonprofit that develops and uses technology to create positive social change, offered a patch that adds the accessibilityFeature property to videos that have captions. If you have microdata enabled, WP YouTube Lyte now will automatically check if captions are available and if so, adds the accessibilityFeature property with value “captions” to the HTML-embedded microdata.

As YouTube only offers information on captions in their API v3, which requires authentication, the check is done in a separate, asynchronous call via a proxy-webservice on api.a11ymetadata.org. You can see an example of what the response looks like here and look at the source code on Github. This webservice-request for captions can be disabled by simply switching off microdata. Alternatively, if you want microdata but not the accessibilityFeature-property, you can use the “lyte_docaptions”-filter to set captions to false (you can find an example in lyte_helper.php_example).

This was the first time someone actively submitted code changes to add functionality to a project of mine, actually. Working with Benetech was a breeze and GitHub is a great platform to share, review and comment code. I for one am looking forward to more high-quality contributions like this one!

Looking at 2013 disappearing fast in the rear view mirror

rearview mirror by Alvaro on FlickrAnother year behind us, another overview in numbers (as done previously for 2011 and 2012).

On a personal note, 2013 has not been the easiest of years, but our lovely daughter’s “lentefeest” (a non-religious rite of passage for 6-year olds) and our holiday in Italy were great highlights though.

Mobile WP YouTube Lyte; no-one said it would be easy!

WP YouTube Lyte and mobile, I must be honest, it is not an easy marriage. Light YouTube Embeds focuses on optimizing performance by displaying a dummy player which takes less then a tenth of what a normal YouTube embed requires. Only when clicking on that dummy player, the real YouTube embed is loaded and auto-played. Simple and efficient, no?

Mobile is an whole other ballgame. For starters, there’s no autoplay on YouTube mobile embeds. At all, because Apple prohibits autoplay in HTML5 video and browsers on Android seem to agree. So the trick with the dummy player does not work (unless you would accept users having to click twice) and as a consequence, WP YouTube Lyte on mobile loads the (mobile) embed straight away.

But that’s not all; for audio-only to work, auto-hide has to be disabled (as the bottom controls are the only player elements that remain visible) but that despite setting autohide=0&controls=1, controls still remain hidden in mobile YouTube embeds, rendering the audio-only player UI useless, as a consequence of which WP YouTube Lyte has to show the full video on mobile. And YouTube playlists on mobile are known to be broken as well, one can only hope this is being worked on by YouTube.

And then one week ago a user posted about yet another mobile-specific problem on the wordpress.org WP YouTube Lyte supportforum; when rotating your smartphone or tablet, the size of the embedded video did not adjust. The reason in a nutshell; while LYTE (the dummy player) is responsive, the YouTube iframe-embed that is loaded on mobile is not. To solve this, I added an orientationchange event handler (WebKit-only to my disappointment, although I do have an alternative approach that I might introduce at a later stage) in version 1.3.3 which I released earlier today, re-requesting the embed when the orientation changes.

The conclusion; WP YouTube Lyte works on mobile, but it is not the most elegant of solutions at this particular stage. So in the spirit of full disclosure; if desktop & performance are key, then WP YouTube Lyte remains one of the best solutions for YouTube on WordPress out there, but if your main target audience is mobile web, you should at least be aware of these limitations (some of which also exist outside of WP YouTube Lyte).

Do not donate to me!

Some people ask me if they can donate for my software. My answer invariably is they can’t, because I don’t want money. Instead I would like them to make a small donation to a good cause!

Why? Well, I’m a very lucky guy, living in the richest region of one of the richest countries of the world and having a full-time job that allows me and my family to live a comfortable life. Software is “just a hobby” which I hope is a small contribution to make the web (and by extension the world) a slightly better place.

So given that context and given the fact that there are many ways in which the world could be made a better place, I would like to ask you to donate any amount of money you think my little projects are worth to a good cause. Just pick one, click and donate!

  • Donate via GiveDirectly which helps people living in extreme poverty by making unconditional cash transfers to them via mobile phone
  • Lend via Kiva, which allows people to lend money via the Internet to low-income / underserved entrepreneurs and students in 70 countries.
  • Support La Quadrature du Net, which is one of Europe’s leading organizations promoting net neutrality, a positive reform of copyright and the protection of privacy (these guys were instrumental in defeating ACTA).

And there are many, many more great causes both locally and internationally that can use our help!

WP YouTube Lyte mobile audio-only degradation

stevygee1987, one of those great WP YouTube Lyte users, discovered that somewhere along the way audio-only embeds stopped working on mobile (iOS & Android).

The root-cause of the problem is that for mobile browsers YouTube does not show the bottom controls any more, even if specifically requested to do so via the iFrame API.

I’m waiting on some bright soul to provide me with a good solution (on stackoverflow, so your upvote might help), but as a temporary workaround audio-only on mobile will be rendered as a normal YouTube video (which YouTube prefers, really, you should not do audio-only if you want to stay within the Terms of Service).

Just for testing purposes, “Alone again or” by Love in a small audio-only embed (unless you’re on mobile, that is);

Love – Alone Again Or (Original Version)
Watch this video on YouTube or on Easy Youtube.

Power users rejoice; WP YouTube Lyte has an API

Power users of WP YouTube Lyte might be particularly interested in the version that is being pushed out as we speak. 1.3.0 comes with an API, allowing you to substantially change the way the plugin works.

You have the following filters to play around with;

  • lyte_settings; filter to change values in the settingsArray without changing the actual setting
  • lyte_content_preparse; filter to change the_content before the httpv-links are being parsed
  • lyte_match_preparse_fragment; filter to change an individual httpv-link before it is parsed
  • lyte_match_postparse_template; filter to change the parsed code before it is merged back in the_content
  • lyte_content_postparse; filter to parse the_content before it is being handed over to the next plugin
  • lyte_css; filter to change WP YouTube Lyte’s CSS
  • lyte_actionsfilters; action to add extra actions or filters, e.g. to make sure widget_text is parsed by lyte_parse as well

The plugin now comes with “lyte_helper.php_example” which is an sample plugin file that, when copied to “/wp-content/plugins/lyte_helper.php” can be activated as a separate plugin and which contains examples of how the API can be used.

For the less tech-savvy users, these are some of the other changes in 1.3.0 (from the changelog):

  • Support for higher quality thumbnails by adding #hqThumb=1 to httpv-link
  • You can disable microdata on a per-video level by adding #noMicrodata=1 to the httpv-link when microdata is enabled.
  • Checkbox on admin-page to flush WP YouTube Lyte cache (which holds title, description, … from YouTube)

As always; feedback, bug reports, feature requests, criticism or code suggestions are more then welcome in the comments or via the contact form.

But whatever you do, make sure to have fun while doing it! This embedded YouTube audio track (a 2h BBC essential mix by Flying Lotus from back in 2008) might help, if you’re into that type of music that is;

Flying Lotus Essential Mix – All 2 Hours – 2008-11-29 High Quality
Watch this video on YouTube or on Easy Youtube.