You are here

function mp3player_player_default_settings in MP3 Player 6

Returns a string of audio player settings.

1 call to mp3player_player_default_settings()
mp3player_rebuild_cache in ./mp3player.module
Rebuild player settings cache.

File

./mp3player.module, line 892
mp3player main module file.

Code

function mp3player_player_default_settings() {
  $player = mp3player_players(1);
  $js_audio_settings = 'AudioPlayer.setup("' . base_path() . variable_get('mp3player_library_path', drupal_get_path('module', 'mp3player') . '/mp3player') . '/player.swf", {';
  $js_audio_settings .= 'width:' . $player['width'] . ',';
  if ($player['autostart'] != 'no') {
    $js_audio_settings .= 'autostart: "yes",';
  }
  if ($player['loopaudio'] != 'no') {
    $js_audio_settings .= 'loop: "yes",';
  }
  if ($player['animation'] != 'yes') {
    $js_audio_settings .= 'animation: "no",';
  }
  if ($player['remaining'] != 'no') {
    $js_audio_settings .= 'remaining: "yes",';
  }
  if ($player['noinfo'] != 'no') {
    $js_audio_settings .= 'noinfo: "yes",';
  }
  if ($player['initialvolume'] != '60') {
    $js_audio_settings .= 'initialvolume: ' . $player['initialvolume'] . ',';
  }
  if ($player['buffer'] != '5') {
    $js_audio_settings .= 'buffer: ' . $player['buffer'] . ',';
  }
  if ($player['encode'] != 'no') {
    $js_audio_settings .= 'encode: "yes",';
  }
  if ($player['checkpolicy'] != 'no') {
    $js_audio_settings .= 'checkpolicy: "yes",';
  }
  if ($player['rtl'] != 'no') {
    $js_audio_settings .= 'rtl: "yes",';
  }
  if ($player['transparentpagebg'] != 'no') {
    $js_audio_settings .= 'transparentpagebg: "yes",';
  }
  if ($player['pagebg'] != NULL) {
    $js_audio_settings .= 'pagebg: "' . $player['pagebg'] . '",';
  }
  if ($player['bg'] != 'E5E5E5') {
    $js_audio_settings .= 'bg: "' . $player['bg'] . '",';
  }
  if ($player['leftbg'] != 'CCCCCC') {
    $js_audio_settings .= 'leftbg: "' . $player['leftbg'] . '",';
  }
  if ($player['lefticon'] != '333333') {
    $js_audio_settings .= 'lefticon: "' . $player['lefticon'] . '",';
  }
  if ($player['voltrack'] != 'F2F2F2') {
    $js_audio_settings .= 'voltrack: "' . $player['voltrack'] . '",';
  }
  if ($player['volslider'] != '666666') {
    $js_audio_settings .= 'volslider: "' . $player['volslider'] . '",';
  }
  if ($player['rightbg'] != 'B4B4B4') {
    $js_audio_settings .= 'rightbg: "' . $player['rightbg'] . '",';
  }
  if ($player['rightbghover'] != '999999') {
    $js_audio_settings .= 'rightbghover: "' . $player['rightbghover'] . '",';
  }
  if ($player['righticon'] != '333333') {
    $js_audio_settings .= 'righticon: "' . $player['righticon'] . '",';
  }
  if ($player['righticonhover'] != 'FFFFFF') {
    $js_audio_settings .= 'righticonhover: "' . $player['righticonhover'] . '",';
  }
  if ($player['loader'] != '009900') {
    $js_audio_settings .= 'loader: "' . $player['loader'] . '",';
  }
  if ($player['track'] != 'FFFFFF') {
    $js_audio_settings .= 'track: "' . $player['track'] . '",';
  }
  if ($player['tracker'] != 'DDDDDD') {
    $js_audio_settings .= 'tracker: "' . $player['tracker'] . '",';
  }
  if ($player['border'] != 'CCCCCC') {
    $js_audio_settings .= 'border: "' . $player['border'] . '",';
  }
  if ($player['skip'] != '666666') {
    $js_audio_settings .= 'skip: "' . $player['skip'] . '",';
  }
  if ($player['text'] != '333333') {
    $js_audio_settings .= 'text: "' . $player['text'] . '",';
  }

  //Remove the last comma otherwise IE will throw a big hissy fit like a little girl
  $js_audio_settings = substr($js_audio_settings, 0, -1);
  $js_audio_settings .= '});';
  return $js_audio_settings;
}