You are here

function video_field_prepare_view in Video 7

Implements hook_field_prepare_view().

File

./video.field.inc, line 117
Implement an video field, based on the file module's file field.

Code

function video_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items) {

  // If there are no files specified at all, use the default.
  foreach ($entities as $id => $entity) {
    if (empty($items[$id]) && $field['settings']['default_video_thumbnail']) {
      if ($file = file_load($field['settings']['default_video_thumbnail']['fid'])) {
        $items[$id][0] = (array) $file + array(
          'is_default' => TRUE,
        );
      }
    }
  }
}