Now when you make a view, by default the only image type not visible to choose is "thumbnailURL", It would be interesting choose between thumbnailURL and videoStillURL because the last one is bigger.

The Previous code:

if ($instance['widget']['type'] == BRIGHTCOVE_VIDEO_WIDGET) {
      $image_types = array(
        'thumbnailURL' => t('thumbnailURL'),
        'videoStillURL' => t('videoStillURL'),
      );

      $element['brightcove_image_type'] = array(
        '#title' => t('Image type'),
        '#type' => 'select',
        '#default_value' => $settings['brightcove_image_type'],
        '#empty_option' => $image_types[0],
        '#options' => $image_types,
      );
    }
    else {
      $element['brightcove_image_type'] = array(
        '#type' => 'value',
        '#value' => 'thumbnailURL',
      );
    }

My solution, deleting the if statement.

$image_types = array(
      'thumbnailURL' => t('thumbnailURL'),
      'videoStillURL' => t('videoStillURL'),
    );

    $element['brightcove_image_type'] = array(
      '#title' => t('Image type'),
      '#type' => 'select',
      '#default_value' => $settings['brightcove_image_type'],
      '#empty_option' => $image_types[0],
      '#options' => $image_types,
    );

My patch:

CommentFileSizeAuthor
#1 brightcove-image-type-2267029.patch1.38 KBjansete
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jansete’s picture

k.dani’s picture

Status: Active » Closed (won't fix)

The problem with your solution is that the Brightcove playlist object do not have 'videoStillURL' parameter, so playlists don't have this kind of image type: http://docs.brightcove.com/en/video-cloud/media/reference.html#Playlist

The problem source is related to views. It always uses the default 'widget type' for a field.

Anyway, the default widget type has been set to brightcove video (#2265967: 'default_widget' inside hook_field_info is set to a widget that doesn't exist.) so that the 'videoStillURL' is available on views admin as well.