You are here

function _swftools_jw5_settings in SWF Tools 6.3

Returns an array of default settings for the JW Player

Return either the full set, or the minimum set, of player settings. The full set is normally request by the administration page in order to populate the form, while the minimum set returns just those settings needed to successfully render a player.

Parameters

string $profile: (optional) Name of profile to use.

int $mode: (optional) Use one of the following constants:

Return value

array An array of settings.

2 calls to _swftools_jw5_settings()
swftools_jw5_profile_form in jw5/swftools_jw5.admin.inc
Returns a form definition for use by the profile system.
_swftools_jw5_flashvars in jw5/swftools_jw5.module
Return the default flashvar configuration for JW Player 4.

File

jw5/swftools_jw5.module, line 112
Enables SWF Tools support for LongTail Player 5.

Code

function _swftools_jw5_settings($profile = '', $mode = SWFTOOLS_MINIMUM_SETTINGS) {

  // Define the defaults for the minimum and full conditions
  $defaults = array(
    SWFTOOLS_MINIMUM_SETTINGS => array(
      'basic' => array(
        'width' => '400',
        'height' => '320',
      ),
      'appearance' => array(
        'fillemptyimages' => 0,
      ),
      'accessibility' => array(
        'accessible' => 0,
      ),
      'imagecache' => array(
        'imagecache_player' => SWFTOOLS_UNDEFINED,
        'imagecache_playlist' => SWFTOOLS_UNDEFINED,
      ),
    ),
    SWFTOOLS_FULL_SETTINGS => array(
      'basic' => array(
        'playlistsize' => '',
        'width' => '400',
        'height' => '320',
      ),
      'color' => array(
        'backcolor' => '',
        'frontcolor' => '',
        'lightcolor' => '',
        'screencolor' => '',
      ),
      'appearance' => array(
        'skin' => '',
        'logo' => '',
        'overstretch' => 'default',
        'controlbar' => 'default',
        'playlist' => 'default',
        'plugins' => '',
        'fillemptyimages' => 0,
      ),
      'playback' => array(
        'autostart' => 'default',
        'bufferlength' => '',
        'displayclick' => 'default',
        'repeat' => 'default',
        'shuffle' => 'default',
        'volume' => '',
      ),
      'interaction' => array(
        'captions' => '',
        'link' => '',
        'linktarget' => 'default',
        'streamscript' => '',
        'type' => 'default',
        'fullscreen' => 'default',
      ),
      'accessibility' => array(
        'accessible' => SWFTOOLS_ACCESSIBLE_DISABLED,
      ),
      'imagecache' => array(
        'imagecache_player' => SWFTOOLS_UNDEFINED,
        'imagecache_playlist' => SWFTOOLS_UNDEFINED,
      ),
    ),
  );

  // TODO: Does this actually work? Once a form has been stored will swftools_variable_get() not
  // always retrieve a full set of variables? The minimum set will only be returned when there
  // are no settings stored in the database?
  // Retrieve current default settings
  $settings = swftools_variable_get('swftools_jwplayer4', $defaults[SWFTOOLS_MINIMUM_SETTINGS], $profile);

  // If a full set of settings are requested for the admin page then merge with full defaults
  if ($mode == SWFTOOLS_FULL_SETTINGS) {
    $settings = swftools_array_merge($defaults[SWFTOOLS_FULL_SETTINGS], $settings);
  }

  // Return resulting defaults
  return $settings;
}