You are here

public function OSMPlayer::getPlayer in MediaFront 6.2

Same name and namespace in other branches
  1. 6 players/osmplayer/player/OSMPlayer.php \OSMPlayer::getPlayer()
  2. 7 players/osmplayer/player/OSMPlayer.php \OSMPlayer::getPlayer()

The main API call for this player. This will return the HTML and JavaScript for the media player that you wish to add to your page.

This function allows for dynamic theming of the player by passing parameters to the media player ( i.e. playlistOnly, horizontal, etc ).

File

players/osmplayer/player/OSMPlayer.php, line 516

Class

OSMPlayer
PHP wrapper class for the Open Standard Media (OSM) player.

Code

public function getPlayer() {
  $output = $this
    ->getJS();
  $output .= "\n";

  // Determine the width and height of the player.
  $width = $this->settings['playlistOnly'] && $this->settings['vertical'] ? '' : 'width:' . $this->settings['width'] . 'px;';
  $width = $this->settings['fluidWidth'] ? 'width:100%;' : $width;
  $height = $this->settings['playlistOnly'] && !$this->settings['vertical'] || $this->settings['controllerOnly'] ? '' : 'height:' . $this->settings['height'] . 'px;';
  $height = $this->settings['fluidHeight'] ? 'height:100%;' : $height;

  // Set the version.
  $this->settings['version'] = $this->template
    ->getVersion();

  // Get the output from the template.
  $output .= $this->template
    ->theme(array(
    'params' => $this->settings,
    'width' => $width,
    'height' => $height,
  ));
  return $output;
}