You are here

function _swftools_flowplayer3_settings in SWF Tools 6.3

Returns an array of default settings for the player.

4 calls to _swftools_flowplayer3_settings()
swftools_flowplayer3_profile_form in flowplayer3/swftools_flowplayer3.admin.inc
swftools_flowplayer3_swftools_playlist_flowplayer3 in flowplayer3/swftools_flowplayer3.module
Implementation of hook_swftools_playlist_PLAYER().
swftools_flowplayer3_swftools_preprocess_flowplayer3 in flowplayer3/swftools_flowplayer3.module
Implementation of hook_swftools_preprocess_[player]().
theme_swftools_flowplayer3 in flowplayer3/swftools_flowplayer3.module
Embeds media on the page using the Flowplayer 3 embedding JavaScript.

File

flowplayer3/swftools_flowplayer3.module, line 312
Enables SWF Tools support for Flowplayer 3.

Code

function _swftools_flowplayer3_settings($profile = '', $static = TRUE) {

  // Cache this
  static $saved_settings = array();

  // We need a name to access the default profile in the array
  $_profile = $profile ? $profile : SWFTOOLS_UNDEFINED;

  // Build settings if we don't already have them
  // TODO : What is $static for??!!
  if (!isset($saved_settings[$_profile]) || !$static) {

    // Define the settings list
    $defaults['clip'] = array(
      'autoPlay' => 'false',
      'autoBuffering' => 'false',
      'scaling' => 'scale',
      'start' => '',
      'duration' => '',
      'accelerated' => 'false',
      'bufferLength' => '',
      'provider' => '',
      'fadeInSpeed' => '',
      'fadeOutSpeed' => '',
      'linkUrl' => '',
      'linkWindow' => '_blank',
      'live' => 'false',
      'cuePointMultiplier' => '',
    );
    $defaults['controls'] = array(
      'backgroundColor' => '#000000',
      'timeColor' => '#01DAFF',
      'durationColor' => '#FFFFFF',
      'progressColor' => '#015B7A',
      'backgroundGradient' => 'medium',
      'progressGradient' => 'medium',
      'bufferColor' => '#6C9CBC',
      'bufferGradient' => 'none',
      'sliderColor' => '#000000',
      'sliderGradient' => 'none',
      'buttonColor' => '#889AA4',
      'buttonOverColor' => '#92B2BD',
      'volumeSliderColor' => '#000000',
      'volumeSliderGradient' => 'none',
      'timeBgColor' => '#555555',
      'autoHide' => 'fullscreen',
      'hideDelay' => 4000,
      'play' => 'true',
      'volume' => 'true',
      'mute' => 'true',
      'time' => 'true',
      'stop' => 'false',
      'playlist' => 'false',
      'fullscreen' => 'true',
      'scrubber' => 'true',
      'top' => '',
      'left' => '',
      'bottom' => '',
      'right' => '',
      'opacity' => '',
      'borderRadius' => 0,
      'scrubberHeightRatio' => 0.4,
      'scrubberBarHeightRatio' => 1,
      'volumeSliderHeightRatio' => 0.4,
      'volumeBarHeightRatio' => 1,
      'timeBgHeightRatio' => 0.7,
    );
    $defaults['canvas'] = array(
      'width' => 500,
      'height' => 375,
      'backgroundColor' => '#000000',
      'backgroundImage' => '',
      'backgroundRepeat' => 'repeat',
      'backgroundGradient' => 'low',
      'border' => '',
      'borderRadius' => '',
    );
    $defaults['logo'] = array(
      'use_logo' => FALSE,
      'displayTime' => 100,
      'fadeSpeed' => 2,
      'opacity' => 1,
      'top' => '45%',
      'right' => '50%',
      'width' => '100%',
      'height' => '100%',
      'zIndex' => 0,
      'url' => '',
      'fullscreenOnly' => 'false',
      'linkUrl' => '',
      'linkWindow' => '_blank',
    );
    $defaults['play'] = array(
      'url' => '',
      'opacity' => 0.8,
      'label' => '',
      'replayLabel' => 'Play again',
      'fadeSpeed' => 500,
      'rotateSpeed' => 50,
      'height' => '10%',
      'width' => '10%',
    );
    $defaults['accessibility'] = array(
      'accessible' => SWFTOOLS_ACCESSIBLE_DISABLED,
    );
    $defaults['playlists'] = array(
      'playlist' => 0,
      'scrollable' => 0,
      'style' => 'petrol',
      'images' => 1,
      'fillemptyimages' => 0,
    );
    $defaults['imagecache'] = array(
      'imagecache_player' => SWFTOOLS_UNDEFINED,
      'imagecache_playlist' => SWFTOOLS_UNDEFINED,
    );

    // Retrieve settings from the database if available
    $saved_settings[$_profile] = swftools_variable_get('swftools_flowplayer3', $defaults, $profile);

    //$saved_colors = variable_get('swftools_flowplayer3_palette', array());
    $saved_colors = swftools_variable_get('swftools_flowplayer3_palette', array(), $profile);
    if ($saved_colors) {

      // Move background color to canvas
      $saved_settings[$_profile]['canvas']['backgroundColor'] = $saved_colors['backgroundColor'];

      // Move control bar background color to controls
      $saved_colors['backgroundColor'] = $saved_colors['controlbarbackgroundColor'];
      unset($saved_colors['controlbarbackgroundColor']);
      $saved_settings[$_profile]['controls'] += $saved_colors;
    }
  }

  // Return resulting defaults
  return $saved_settings[$_profile];
}