I am using media:youtube latest module with Media module to publish you tube videos , but thumbnail preview images are not generating, I have tried various way and patch to solve this issue that I find over the community forum but nothing worked, Is any one else face similar problem ? any one can help me in this that will be great help for me.

Comments

prestondocks’s picture

Same here, I just get a film strip icon instead of the video thumbnail. What i have to do is search you tube first and get the reference number for the video and use that for the search. Otherwise I cant see what video I am inserting into my node.

Rob C’s picture

This started when the new default images where implemented? Got a media_soundcloud repo that has the same issue. Check your sites/default/files folder to see if the image actually exists. In my case, they are created, but the default thumbnails (film strip) are used instead of the correct 'real' thumbnails. I found this couple days ago already with the youtube module. Try to search for videos on the Youtube tab on the media browser > same story. So this looks more like a media module issue.

update: film strip icon:

That's the settings. The default weight for the youtube display mode is the same as the 'Large filetype icon'. (youtube icon / film strip icon). You can change this at: admin/structure/file-types/manage/video/file-display (for video) > 'Display precedence order'.

johnhanley’s picture

This issue is alive and well using the latest dev snapshot dated Sept. 30.

I can confirm this was recently introduced as the youtube thumbnails displayed correctly in the previous dev snapshot dated Sept. 17.

I am required to use this latest Sept. 30 version because of the playlist patch.

I tried messing with the Video file type settings, but was unsuccessful in getting the thumbnails to appear while using the media browser. This close to launch the client is good for now using it w/o the thumbnails.

mobonobomo’s picture

I was having the same problem, where all I saw was the blank film strip icon. The fix is surprisingly easy. Go to Content > File Types > Video > Manage file display, click the "Preview" button, and change the display precedence order so that "YouTube Preview Image" is first, before "Large filetype icon". Then, where you want to display the preview image, select "Rendered file" and "Preview", in Views, etc.

johnhanley’s picture

@mobonobomo,

You are my hero!

I back-burner'ed this issue, but your post intrigued me so I decided to make a quick attempt to get the thumbnails to appear while browsing videos using the media browser. I followed your instructions and viola, thumbnails!

Thanks so much for posting the solution. It's not at all obvious. My client was expecting to defer this issue until after launch, but what a nice surprise for them. :-)

I'm not sure if this completely solves the OP's issue though. I will let the project maintainer decide.

Cheers,
John

Devin Carlson’s picture

Priority: Critical » Normal
Status: Active » Closed (duplicate)
amittarkar’s picture

@mobonobomo: Thanks for help, It solved problem but When I search youtube videos by putting some keywords in media browser, the videos appear in the search result again gets displayed with that default file icon and the names of videos are just meaningless

13rac1’s picture

@amittarkar You've got to change the settings for the video render on the search results also.

rad_one’s picture

#4 didn't work for me (settings link is /admin/structure/file-types/manage/video/file-display)
drupal-7.23 + media-7.x-2.x-dev (2013-10-31) + media_youtube-7.x-2.0-rc4 (2013-10-26)
With "YouTube Preview Image" before "YouTube Video", when I go to full contact rendering is stalled because it can't generate preview thumbnail.

I downgraded to media_youtube-7.x-2.0-rc3 (2013-05-01) thumbnail generating works fine.

Any idea for media_youtube-7.x-2.0-rc4 preview thumbnails generating issue, please ?

morenstrat’s picture

Issue summary: View changes
Status: Closed (duplicate) » Needs work

Re-opening because the fix from #2106261: Update default settings 'weight' did not solve this issue for me. The preview image is not generated and even as user 1, I get an access denied error. File system permissions are correct.

Nodz’s picture

I can confirm I'm stilll getting the problem in the latest version.

It seems to be because when trying to render a thumbnail/preview it uses file_uri_to_object() to create a temporary copy of the video. however it uses the same theme functions as the videos that are already in the database. These have a local copy of the video preview and as such use a file entity. The them doesn't know what to do with a file of type video when it expects and image and it all goes down hill from here.

Obviously it doesn't make sense to create local images for every youtube search but it seems the recent updates of media make it tricky to use external images in rendering.

I tried many ways of tweaking the data passed in at various levels but it seems relying on any of media's functions wont work here because it fails to render external images correctly.

To get the youtube preview image in the media_youtube_add() function you can use:

// wrap the media file:
$youtube = new MediaYouTubeStreamWrapper();
// We force the uri to parse here because passing it in the constructor doesn't parse the parameters
$youtube->setUri($uri);
$youtube->getOriginalThumbnailPath()

I'm still puzzled as how to render that through media, perhaps a custom theme function would work better here. For a quick fix i simply did this:

// Quick fix
      $dirty_render = '<div title="'.$file->filename.'" class="media-item" data-fid="0"><div class="media-thumbnail"><span class="file"><img alt="" title="video/youtube" src="'.$youtube->getOriginalThumbnailPath().'"> <a href="http://www.youtube.com/watch?v='.$file->filename.'" type="video/youtube; length=0">'.$file->filename.'</a></span><div class="label-wrapper"><label class="media-filename">'.$file->filename.'</label></div></div></div>';
//Then i pass that into the array instead of $file->preview

But it's not at all a proper solution.

bneil’s picture

Nodz,

Is this happening for you only when you use the YouTube tab in the media overlay?

I do not see this issue occur when I use the Web tab and past in a YouTube url.

gos.sebastian’s picture

I have the same module versions on dev and production server. On production I have "https", on dev not and also have this problem. On production server I don't have youtube video thumbnails.

<div class="media-thumbnail">
  <div class="media-youtube-video media-youtube-id">
    <iframe>here is video on dev</iframe>
  </div>
</div>
gos.sebastian’s picture

Status: Needs work » Needs review

Sory for delay but have no time to write it previously. I solve my problem by this:

I found that on admin/structure/file-types/manage/video/file-display there is a list of file displays. Go to file "Preview" display admin/structure/file-types/manage/video/file-display/preview and select "YouTube Preview Image" and "YouTube Video"

nicstar’s picture

+1 to #14 - this is what we had to do to correct the problem.

mansspams’s picture

Status: Needs review » Closed (works as designed)

Needs review if for patches, this one is not broken.

Romain Trenet’s picture

Hello,
The path has changed.

The correct path is now :
admin/config/media/file-types/manage/video/file-display/media_preview