You are here

function brightcove_video_upload in Brightcove Video Connect 7.6

Same name and namespace in other branches
  1. 7.7 brightcove.video.inc \brightcove_video_upload()

Menu callback to display the video upload dialog.

1 string reference to 'brightcove_video_upload'
brightcove_menu in ./brightcove.module
Implements hook_menu().

File

./brightcove.video.inc, line 622
Brightcove video related functions.

Code

function brightcove_video_upload($entity_type, $field_name, $bundle_or_id, $client) {
  $values = [
    'client' => $client,
    'type' => 'brightcove_video',
  ];
  $bundle = $bundle_or_id;
  if (is_numeric($bundle_or_id)) {
    $entity = entity_load_single($entity_type, $bundle_or_id);
    $info = entity_get_info($entity_type);
    $bundle_key = $info['entity keys']['bundle'];
    $bundle = $entity->{$bundle_key};
  }
  $video_entity = brightcove_video_create($values);
  $form = drupal_get_form('brightcove_video_form', $video_entity, $entity_type, $bundle, $field_name);
  return drupal_render($form);
}