You are here

function brightcove_admin_embed_view in Brightcove Video Connect 7.6

Same name and namespace in other branches
  1. 7.7 brightcove.player.inc \brightcove_admin_embed_view()

Page callback for 'admin/config/media/brightcove/players/%/%/%'.

Parameters

string $bcid:

string $player_id:

string $embed_id:

Return value

array

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

File

./brightcove.player.inc, line 382

Code

function brightcove_admin_embed_view($bcid, $player_id, $embed_id) {
  $client = brightcove_client_load($bcid);
  if (!$client) {
    drupal_not_found();
  }

  /** @var \Brightcove\API\PM $pm */
  list(, , $pm) = brightcove_create_classes($client);
  $build = brightcove_try(function () use ($player_id, $embed_id, $pm) {
    $build = [];
    $embed = $pm
      ->getEmbed($player_id, $embed_id);
    $build['widget'] = [
      '#markup' => $embed
        ->getEmbedCode(),
    ];
    return $build;
  });
  if (!$build) {
    drupal_not_found();
  }
  return $build;
}