You are here

public static function JwPlayer::getDefaultSettings in JW Player 8

Default JW PLayer settings.

Return value

array Returns the default settings for JW Player. Used in cases where a preset is not provided when the JW Player theme function is called.

1 call to JwPlayer::getDefaultSettings()
JwPlayer::preRenderPlayer in src/Element/JwPlayer.php
#pre_render callback for #type 'jw_player'.

File

src/Element/JwPlayer.php, line 172

Class

JwPlayer
Provides a render element for a table.

Namespace

Drupal\jw_player\Element

Code

public static function getDefaultSettings() {
  $defaults = array(
    'width' => '640',
    'height' => '480',
    'mode' => 'html5',
    'autostart' => FALSE,
    'controlbar' => 'bottom',
    'advertising' => array(
      'client' => '',
      'tag' => '',
    ),
  );
  $library_discovery = \Drupal::service('library.discovery');
  $library = $library_discovery
    ->getLibraryByName('jw_player', 'jwplayer');
  if (!empty($library['library path'])) {
    $defaults['base'] = file_create_url($library['library path'] . '/');

    // JW Player 7+ no longer uses the base for the flash path but supports
    // an explicit configuration option for it again.
    $defaults['flashplayer'] = $defaults['base'] . 'jwplayer.flash.swf';
  }
  return $defaults;
}