WP YouTube Lyte: new player UI and API tips

WP YouTube Lyte 1.6.4 was released a couple of hours ago and features the new YouTube player look and feel:

Vieux Farka Touré & Julia Easterlin - Little Things (Music Video)

Here are some tips on how you can tweak that to match your own preferences;
As you can see in the vid above (Vieux Farka Touré & Julia Easterlin – Little Things), I wanted WP YouTube Lyte to show the bottom control (which as on YouTube is now invisible by default) add can be accomplished with just a little CSS:
.ctrl{display:block !important;}</code>

If you’d like Lyte to use the exact same font as YouTube does, you can add CSS to import that font and it will be applied to title-field in Lyte:

@import url(https://fonts.googleapis.com/css?family=Roboto&subset=latin,latin-ext);

You can even use Lyte’s API do alter the CSS like this;

add_filter('lyte_css','lyte_change_css',10,1);
function lyte_change_css($lyte_css) {
        // source the font
        $lyte_css="@import url(https://fonts.googleapis.com/css?family=Roboto&subset=latin,latin-ext);".$lyte_css;
        // show bottom control
        $lyte_css.=" .ctrl{display:block !important;}";
        return $lyte_css;
}

Talking about the API, you can now also force Lyte to be active on mobile as well (which is not the default as it would force your visitors to click “play” twice, once to load the YouTube iFrame and once to play as mobile YouTube doesn’t support autoplay), you can use this code;

add_filter('lyte_do_mobile','lyte_on_mobile',10,0);
function lyte_on_mobile(){
        return true;
}

WP YouTube Lyte on Android: native or in-browser playback?

With the latest release of WP YouTube Lyte I fixed a problem where iOS users had to click twice to view a LYTE-embedded video; once to activate the iOS YouTube player and once to start the actual playing. On Android that problem does not exist, as LYTE embeds can be played inline in the browser.
Based on my own tests however, performance and quality aren’t always optimal when compared to the experience the native YouTube app provides. So now I’m wondering; wouldn’t it be better to not only detect iOS, but also Android and have both of them play in their respective a native players, even if on Android this isn’t an absolute requirement?
Advantages:

  1. better video playback performance/ quality
  2. somehow feels more professional (it’s the way the YouTube mobile site seems to work as well for example)

Disadvantages:

  1. you force visitors out of the context of your webpage
  2. a small percentage of Android visitors will get an ugly error message as they do not have a native YouTube player
  3. only works for single video’s, not for playlists (or at least so it seems) and the audio-only trick obviously won’t work either

What do you think? Speak now or be silent forever!
And let me throw in a vid (Spiritualized with “Hey Jane” live) just for the heck of it;

Spiritualized - Hey Jane (live @ Maida Vale for BBC 6 Music)

And if you’re on Android you can click here to trigger the YouTube app to see the exact same thing.