• I had the video thumbnails working at some point. But then one day all my thumbnails weren’t appearing anymore and I couldn’t add new ones. Not even when I’ve reinstalled the plugin and added new video posts I get the same message ‘We didn’t find a video thumbnail for this post.’

    I’m using WP YouTube Lyte to embed my videos and my embeds look like this: httpv://www.youtube.com/watch?v=ct5Q73pgVMA

    Please help! I’m up against a deadline and I’d be happy to donate to this plugin if I can get it working correctly.

    Thanks!
    Kim

    http://wordpress.org/extend/plugins/video-thumbnails/

Viewing 11 replies - 1 through 11 (of 11 total)
  • You can try replacing in video-thumbnails.php from line 124 this

    // Checks for any YouTube URL
    		if(!isset($matches[1])) {
    			preg_match('#http://w?w?w?.?youtube.com/watch\?v=([A-Za-z0-9\-_]+)#s', $markup, $matches);
    		}

    with

    // Checks for any YouTube URL
    		if(!isset($matches[1])) {
    			preg_match('#httpv?://w?w?w?.?youtube.com/watch\?v=([A-Za-z0-9\-_]+)#s', $markup, $matches);
    		}

    The difference is the added v?, which makes the plugin seek for Youtube URLs both with and without the v in httpv.

    Please tell us if this helped, it will help further development by the plugin admin.

    For the plugin admin: Looking at the code it seems like it would fail to notice Youtube videos loaded through https. Haven’t tested it.

    Also, there’s a typo on line 530 saying // Aministration without a d.

    Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    Thanks Daedalon, I should probably just remove everything before youtube.com

    That might mess with the cases when a user simply wants to link to a Youtube video without embedding. Then it might not be desirable to have the plugin fetch a thumbnail.

    After a moment’s thought I feel the only secure way is the way it currently is: having the plugin check for several specific ways of embedding. The copy-paste one with iframes or in the older way, both with and without https, and then the plugin-specific ones.

    Today I found out that Smart Youtube 4.0.3 allows embedding via a youtu.be link. There are also several ways for linking through it: httpv, httpvh, httpvp, httpvhp (the last two ones are playlists) and all of these work for all the hosts it supports. It can also be set in the options to treat http:// links in the same way as httpv:// ones, and even those without the protocol prefix.

    To recognize all of the abovementioned Smart Youtube uses:

    preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?youtube\.com\/watch(\?v\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{11})([^<\s]*)/", $content, $matches['youtube.com'], PREG_SET_ORDER );
    	preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?youtu\.be\/([a-zA-Z0-9\-\_]{11})/", $content, $matches['youtu.be'], PREG_SET_ORDER );
    	preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?metacafe\.com\/watch\/([a-zA-Z0-9\-\_]{7})\/([^<^\/\s]*)([\/])?/", $content, $matches['metacafe.com'], PREG_SET_ORDER );
    	preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?vimeo\.com\/([a-zA-Z0-9\-\_]{8})([\/])?/", $content, $matches['vimeo.com'], PREG_SET_ORDER );
    	preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?liveleak\.com\/view(\?i\=)([a-zA-Z0-9\-\_]*)/", $content, $matches['liveleak.com'], PREG_SET_ORDER );
    	preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?facebook\.com\/video\/video.php\?v\=([a-zA-Z0-9\-\_]*)/", $content, $matches['facebook.com'], PREG_SET_ORDER );

    To add support for https make http(v|vh|vhd)? be http(v|vh|vhd|s)? by adding the |s inside the brackets. I don’t think there’s a case of httpvs, because Smart Youtube uses specifically httpv without supporting https. In case it would support it’d be equally easy to add. Depending on the implementation it could be for example http(v|vh|vhd)?s?, which allows for the s to be after http, httpv, httpvh and httpvhd.

    Mr. Prelovac: Would you add support for https for the next Smart Youtube version? The aim is twofold: 1. Recognize https:// Youtube links in the same manner as http:// ones and 2. make Smart Youtube’s output use https if the user has chosen this in the settings. This is needed on https sites to avoid “the site is trying to load non-secure content” warnings.

    Can’t speak for Vladimir, but I’ll add support to https to my todo-list for the next version of WP YouTube Lyte (as that’s what the original poster is using).

    The logical construct would be to have the ‘s’ before the type of embedding identifier, as the ‘s’ is part of ‘https’? So httpsv and httpsa for WP YouTube Lyte (and httpsv, httpsvh and httpsvhd for Smart Youtube Pro)?

    Thanks for your comment, futtta, you’re right. https?v?h?d? could make most sense for catching thumbnails of Smart Youtube embeds and https?(v|vh|vhd)? for matching inside its own code once it supports https.

    https?v?h?d? could be improved still as it’s a bit loose and catches for example httpvd that is not something that Smart Youtube produces.

    I was changing my code to cater for http(s?)(v|a), but I think I’m going to roll back the changes. Here’s why (looking for feedback here);

    The only non-negociable reason for embedding a https-video, is if your site is in https. But as it’s easy enough to check for that from within the plugin and to force the youtube-links to be https, there’s no need for the user to be able to specify https, no?

    So the trigger would remain http(v|a)://youtu.be/… but depending on the context the plugin will embed the http or https-version of the youtube video?

    That makes sense. You can provide support for any combination of these three that come to mind:

    1. Have the plugin recognize if the site is being browsed by http or https and then embed the links accordingly. This alone might cover all the most likely use cases that come to mind without needing any extra options.

    2. Have a setting on the plugin options to make all embeds use either http or https. This may come handy if some people trust their own site (an intranet for example) but are less trusting towards their connection with the outside world.

    3. You can let the embedder specify one video to be embedded in http and another one in https. Could be useful for for example debugging or other marginal purposes, when no change for the whole site is desirable and the site doesn’t have an SSL cert itself. Can’t see a downside to supporting this.

    i’ve implemented (1) in the upcoming 0.9.4, that clearly is the most important one. we’ll see if more is needed later on. thanks for your input! 🙂

    Good work!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: Video Thumbnails] We didn't find a video thumbnail for this post.’ is closed to new replies.