I have recently installed a new clean core updating my D7 sites and have noticed mediafront is not loading thumbnails for youtube content
added with the media module browser or content media selector.
The youtube content plays fine in the oms player along with uploaded video.
But the thumbnail is not being passed for the youtube linked video media field.

Is this a know issue with media and mediafront modules or an issue with my local install.
Anybody else have this issue?
thanks for any info.

Thanks for the work on the D7 build!!

CommentFileSizeAuthor
#2 mediafront.module.zip6.51 KBandrewadams2099

Comments

andrewadams2099’s picture

The module is released under GPLV3 so you are allowed to have a look at the source code and change anything to suit your needs.
My brother needed a website that could play youtube, vimeo and other video types so I ran into a similar small issue when using mediafront.
Basically I added a url field to my content type called field_mediafront_url (for the vimeo and youtube video links) and added two functions to get the thumbnails.

I Added two functions to my mediafront.module then

function getYoutubeThumbnail($url) {
    preg_match('/[\\?\\&]v=([^\\?\\&]+)/', $url, $matches);
    $videoid = $matches[1];
    return "http://img.youtube.com/vi/" .$videoid . "/hqdefault.jpg";
}

function getVimeoThumbnail($url) {
    preg_match("/(\\d+)/is", $url, $matches); //grab the vimeo video id
    $imgid = $matches[1];
    $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$imgid.php"));
    return $hash[0]['thumbnail_large'];
}

I'll upload my version of mediafront.module in a sec as to show how I edited it to use the two functions above.
Basically if no image is added and its a youtube or vimeo video it will use the thumbnail from youtube or vimeo.
Youtube itself generates several different thumbnails so I am unsure that the hqdefault.jpg will work everytime.

andrewadams2099’s picture

StatusFileSize
new6.51 KB

Here it is. Just replace this file with the one in your mediafront directory and create a text field called "field_mediafront_url"
Let me know if you need any help getting this to work.

travist’s picture

Thank you so much for your contribution andrew.

I will look at adding this to the latest build!

Travis.

ckani’s picture

Hi Travis,

Has this functionality been added to the dev version. In my use case I need users to be able to click on a linked thumbnail that points to the full node . Currently, all the YouTube thumbnails link to media/1 or media/2, etc, where the YouTube embedded video shows and works as expected (I think), except it looks like that link is created by medal or media YouTube.

On full nodes mediafront works great, but I can't get the thumbnail to link to it's node. I've already posted posted in the issue queue of Media youtube, but thought I'd try here too.

Drupal 7.7 with latest devs of mediafront, styles, views, media and media youtube.

Thanks

ckani’s picture

Hi Travis,

Has this functionality been added to the dev version. In my use case I need users to be able to click on a linked thumbnail that points to the full node . Currently, all the YouTube thumbnails link to media/1 or media/2, etc, where the YouTube embedded video shows and works as expected (I think), except it looks like that link is created by media or media YouTube.

On full nodes mediafront works great, but I can't get the thumbnail to link to it's node. I've already posted posted in the issue queue of Media youtube, but thought I'd try here too.

Drupal 7.7 with latest devs of mediafront, styles, views, media and media youtube.

Thanks

enjoylife’s picture

Status: Active » Closed (fixed)

This has been fixed in the 7.x-2.x version.