1

Ok here what's the situation I have,

I made content-type of Products with 2 fields: Image field and Video field with unlimited inputs.

Using MediaFront module and Views I made a block for displaying all the video's on my node with the playlist which works just fine except it doesn't load the thumbnail by itself.

Reading the documentation of the module you need to set another field (i.e. image field) as the thumbnail.

I can make this 2 ways:

  1. make the playlist get the thumbnail automatically from the video which I have no idea how to that.

  2. make every video that I upload has it's own image as thumbnail which kinda works weird. What I mean is that it only shows the first image of the Imagefield for all the videos.

Here's the address of the page I'm working on.

The Output of the view:

$view = new view();
$view->name = 'media';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'media';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'media';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'mediaplayer';
$handler->display->display_options['style_options']['mediafront_preset'] = 'video_thumbs';
/* Field: Content: videos */
$handler->display->display_options['fields']['field_product_videos']['id'] = 'field_product_videos';
$handler->display->display_options['fields']['field_product_videos']['table'] = 'field_data_field_product_videos';
$handler->display->display_options['fields']['field_product_videos']['field'] = 'field_product_videos';
$handler->display->display_options['fields']['field_product_videos']['label'] = '';
$handler->display->display_options['fields']['field_product_videos']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_product_videos']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_product_videos']['type'] = 'mediafront_player';
$handler->display->display_options['fields']['field_product_videos']['settings'] = array(
  'preset' => 'video_thumbs',
);
$handler->display->display_options['fields']['field_product_videos']['delta_offset'] = '0';
/* Sort criterion: Content: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Contextual filter: Content: Nid */
$handler->display->display_options['arguments']['nid']['id'] = 'nid';
$handler->display->display_options['arguments']['nid']['table'] = 'node';
$handler->display->display_options['arguments']['nid']['field'] = 'nid';
$handler->display->display_options['arguments']['nid']['default_action'] = 'default';
$handler->display->display_options['arguments']['nid']['default_argument_type'] = 'node';
$handler->display->display_options['arguments']['nid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['nid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['nid']['summary_options']['items_per_page'] = '25';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
  'products' => 'products',
);

/* Display: main video player block */
$handler = $view->new_display('block', 'main video player block', 'block_1');
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'mediaplayer';
$handler->display->display_options['style_options']['mediafront_preset'] = 'openstandard';
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['defaults']['header'] = FALSE;
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Field: Content: videos */
$handler->display->display_options['fields']['field_product_videos']['id'] = 'field_product_videos';
$handler->display->display_options['fields']['field_product_videos']['table'] = 'field_data_field_product_videos';
$handler->display->display_options['fields']['field_product_videos']['field'] = 'field_product_videos';
$handler->display->display_options['fields']['field_product_videos']['label'] = '';
$handler->display->display_options['fields']['field_product_videos']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_product_videos']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_product_videos']['settings'] = array(
  'preset' => 'openstandard',
);
$handler->display->display_options['fields']['field_product_videos']['group_rows'] = FALSE;
$handler->display->display_options['fields']['field_product_videos']['delta_offset'] = '0';
/* Field: Content: Images */
$handler->display->display_options['fields']['field_product_images']['id'] = 'field_product_images';
$handler->display->display_options['fields']['field_product_images']['table'] = 'field_data_field_product_images';
$handler->display->display_options['fields']['field_product_images']['field'] = 'field_product_images';
$handler->display->display_options['fields']['field_product_images']['label'] = '';
$handler->display->display_options['fields']['field_product_images']['exclude'] = TRUE;
$handler->display->display_options['fields']['field_product_images']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_product_images']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_product_images']['settings'] = array(
  'image_style' => '',
  'image_link' => '',
);
$handler->display->display_options['fields']['field_product_images']['delta_offset'] = '0';
$handler->display->display_options['block_description'] = 'main video player block';

I'd really appreciate any helps.

1

Ok I read the whole documentation and at the moment there's no way of using two separate fields to add infinite number of videos and images and get proper thumbnailing, here's how I did it:

Created a separate content-type called Videos including these fields:

  • Video
  • Thumbnail
  • Title

for each video, I upload the thumbnail of it as well.

Then at my Products content-type I added the Entity Reference field so I can reference the videos I want for my products this way.

then in Views I created a block as following image to add on my products node: enter image description here

I know that it isn't what I wanted and it has some thumbnail uploading work to do but to my knowledge it was the only way I could find to make this happen without any extra coding.

0

In the Image field add the path to your image overlay, then re-write the display of the video. Or use youtube API wich is returning you the image and all results.

here is the link to youtube API thumbnails Youtube API v3 Hope it helps! I've done the same thing on a couple of websites.

  • Thanks for the answer but I must host the videos on my own host not youtube, also I need a bit more detail than add the path and re-write, how should I do that? rewrite the video with what? I appreciate it if you could collaborate a bit more. – Sohail Apr 23 '14 at 9:56
  • you will have to re-write the rendering of video pages, in the meaning of... display all the videos list with the assigned image desired and with javascript set a click event to play the video, check this page. This page is done exactly how I am trying to explain – no name Apr 23 '14 at 10:48
  • Well using MediaFront the module does the javascript part by iteself, but if you take a look at the question it says that I use only 1 field to add all the videos and 1 field to add all the images, as you can see only first image is assigned to the videos – Sohail Apr 23 '14 at 13:47
0

I don't know if you are in the same situation than this guy but maybe his article could help you to generate automatically thumbnails from your videos with MediaFront module: http://blog.netflowdevelopments.com/2011/11/20/drupal-fun-auto-generating-playlist-thumbnails-from-videos/

  • I stumbled upon this on my google search as well but it is kinda hard to configure it all, I'm not sure if it works or not, I mostly look for a views-way of handling this problem but I'll look into this that you mentioned and let you know. – Sohail Apr 23 '14 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.