Hmmm… looking at the surface of wordTube I don’t immediately know how to add support for it. At the moment my plugin uses methods provided by the video services to retrieve the thumbnail. I’ll look into it some more and see if I figure something out.
I came up with some code to get the image from wordtube:
<?php //wordtube
$content = $post->post_content;
$wordtubeshortcode = stripos($content, "[media");
if($wordtubeshortcode !== false){
$matches = array();
$html = $post->post_content;
$pattern = "/\[media id=(\d+)\]/";
preg_match( $pattern, $html, $matches );
$wordtubeId = $matches['1'];
$wordtubeimage = $wpdb->get_var($wpdb->prepare("SELECT image FROM $wpdb->wordtube WHERE vid = $wordtubeId;"));
echo '<img src="'.$wordtubeimage.'">';
}?>
It does not work with the legacy [media=#] or [media id=# width=# height=#]
to use width and height use:
$pattern = "/\[media id=(\d+)(?: width=)?(\d+)?(?: height=)?(\d+)?\]/";
Hopefully someone can improve on this.
Cheers