You are here

function KalturaHelpers::getSitePlayers in Kaltura 7.3

Same name and namespace in other branches
  1. 6.2 kaltura_client/kaltura_helpers.php \KalturaHelpers::getSitePlayers()
  2. 7.2 kaltura_client/kaltura_helpers.php \KalturaHelpers::getSitePlayers()

oferc @return: the list of players defined for the account

1 call to KalturaHelpers::getSitePlayers()
KalturaHelpers::getSitePlaylistPlayers in kaltura_client/kaltura_helpers.php
oferc this method is defined just for clearence, acctualy it is the same as regular players @return: the list of players defined for the account

File

kaltura_client/kaltura_helpers.php, line 209

Class

KalturaHelpers
Class KalturaHelpers.

Code

function getSitePlayers(&$arr) {
  static $players;
  $arr['48501'] = array(
    'name' => 'Light',
    'width' => 0,
    'height' => 0,
  );
  $arr['48502'] = array(
    'name' => 'Dark',
    'width' => 0,
    'height' => 0,
  );
  if (empty($players)) {
    try {
      $players = array();
      $k_helpers = new KalturaHelpers();
      $client = $k_helpers
        ->getKalturaClient(true);
      $listResponse = $client->uiConf
        ->listAction();
      foreach ($listResponse->objects as $obj) {
        if ($obj->objType == KalturaUiConfObjType::PLAYER) {

          // Don't show playlist as regular player.
          if (stristr($obj->tags, "playlist") != FALSE) {
            continue;
          }
          $arr[$obj->id] = array(
            'name' => $obj->name,
            'width' => $obj->width,
            'height' => $obj->height,
          );
          $players[$obj->id] = array(
            'name' => $obj->name,
            'width' => $obj->width,
            'height' => $obj->height,
          );
        }
      }
    } catch (Exception $e) {
      watchdog_exception('kaltura', $e);
    }
  }
  else {
    foreach ($players as $key => $sitePlayer) {
      $arr[$key] = $sitePlayer;
    }
  }
}