You are here

function brightcove_embed_list in Brightcove Video Connect 7.6

Same name and namespace in other branches
  1. 7.7 brightcove.module \brightcove_embed_list()

Returns the names of the available embeds for the specified player.

Parameters

$player: The player for which embeds should be returned.

$client: Brightcove client entity object.

Return value

mixed Array of embed IDs with names.

2 calls to brightcove_embed_list()
_brightcove_field_playlist_widget_form in ./brightcove_field.playlist.inc
Helper function to return the playlist widget form.
_brightcove_field_video_widget_form in ./brightcove_field.video.inc
Helper function to return the video widget form.

File

./brightcove.module, line 2845
Brightcove module is an integration layer between any modules using Brightcove API. It makes all necessary checks for the API and makes settings available to the user.

Code

function brightcove_embed_list($player, $client) {
  list(, , $pm) = brightcove_create_classes($client);
  $embeds = $pm
    ->listEmbeds($player)
    ->getItems();
  foreach ($embeds as $embed) {
    if ($embed
      ->getId() === 'default') {
      $embed_list[$embed
        ->getId()] = $embed
        ->getName() . " (" . $embed
        ->getId() . ")";
    }
    else {
      $embed_list[$embed
        ->getId()] = $embed
        ->getBranches()
        ->getMaster()
        ->getConfiguration()
        ->getEmbedName() . " (" . $embed
        ->getId() . ")";
    }
  }
  return $embed_list;
}