You are here

public static function BrightcoveUtil::getDefaultPlayer in Brightcove Video Connect 3.x

Same name and namespace in other branches
  1. 8.2 src/BrightcoveUtil.php \Drupal\brightcove\BrightcoveUtil::getDefaultPlayer()
  2. 8 src/BrightcoveUtil.php \Drupal\brightcove\BrightcoveUtil::getDefaultPlayer()

Helper function to get default player for the given entity.

Parameters

\Drupal\brightcove\BrightcoveVideoPlaylistCMSEntityInterface $entity: Video or playlist entity.

Return value

string The ID of the player.

1 call to BrightcoveUtil::getDefaultPlayer()
_brightcove_get_player_field in ./brightcove.module
Gets a player field for the given entity.

File

src/BrightcoveUtil.php, line 399

Class

BrightcoveUtil
Utility class for Brightcove.

Namespace

Drupal\brightcove

Code

public static function getDefaultPlayer(BrightcoveVideoPlaylistCMSEntityInterface $entity) {
  if ($player = $entity
    ->getPlayer()) {
    return BrightcovePlayer::load($player)
      ->getPlayerId();
  }
  $api_client = self::getApiClient($entity
    ->getApiClient());
  return $api_client
    ->getDefaultPlayer();
}