You are here

function mp3player_player_settings in MP3 Player 6

Same name and namespace in other branches
  1. 6.2 mp3player.module \mp3player_player_settings()
  2. 7.2 mp3player.module \mp3player_player_settings()

Returns a string of audio player settings.

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

File

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

Code

function mp3player_player_settings($pid = 1) {
  $players = mp3player_players();
  $default = $players[1];
  $player = $players[$pid];
  $js_audio_settings = NULL;
  if ($player['width'] != $default['width']) {
    $js_audio_settings .= 'width:' . $player['width'] . ',';
  }
  if ($player['autostart'] != $default['autostart']) {
    $js_audio_settings .= 'autostart: "' . $player['autostart'] . '",';
  }
  if ($player['loopaudio'] != $default['loopaudio']) {
    $js_audio_settings .= 'loop: "' . $player['loopaudio'] . '",';
  }
  if ($player['animation'] != $default['animation']) {
    $js_audio_settings .= 'animation: "' . $player['animation'] . '",';
  }
  if ($player['remaining'] != $default['remaining']) {
    $js_audio_settings .= 'remaining: "' . $player['remaining'] . '",';
  }
  if ($player['noinfo'] != $default['noinfo']) {
    $js_audio_settings .= 'noinfo: "' . $player['noinfo'] . '",';
  }
  if ($player['initialvolume'] != $default['initialvolume']) {
    $js_audio_settings .= 'initialvolume: ' . $player['initialvolume'] . ',';
  }
  if ($player['buffer'] != $default['buffer']) {
    $js_audio_settings .= 'buffer: ' . $player['buffer'] . ',';
  }
  if ($player['encode'] != $default['encode']) {
    $js_audio_settings .= 'encode: "' . $player['encode'] . '",';
  }
  if ($player['checkpolicy'] != $default['checkpolicy']) {
    $js_audio_settings .= 'checkpolicy: "' . $player['checkpolicy'] . '",';
  }
  if ($player['rtl'] != $default['rtl']) {
    $js_audio_settings .= 'rtl: "' . $player['rtl'] . '",';
  }
  if ($player['transparentpagebg'] != $default['transparentpagebg']) {
    $js_audio_settings .= 'transparentpagebg: "' . $player['transparentpagebg'] . '",';
  }
  if ($player['pagebg'] != $default['pagebg']) {
    $js_audio_settings .= 'pagebg: "' . $player['pagebg'] . '",';
  }
  if ($player['bg'] != $default['bg']) {
    $js_audio_settings .= 'bg: "' . $player['bg'] . '",';
  }
  if ($player['leftbg'] != $default['leftbg']) {
    $js_audio_settings .= 'leftbg: "' . $player['leftbg'] . '",';
  }
  if ($player['lefticon'] != $default['lefticon']) {
    $js_audio_settings .= 'lefticon: "' . $player['lefticon'] . '",';
  }
  if ($player['voltrack'] != $default['voltrack']) {
    $js_audio_settings .= 'voltrack: "' . $player['voltrack'] . '",';
  }
  if ($player['volslider'] != $default['volslider']) {
    $js_audio_settings .= 'volslider: "' . $player['volslider'] . '",';
  }
  if ($player['rightbg'] != $default['rightbg']) {
    $js_audio_settings .= 'rightbg: "' . $player['rightbg'] . '",';
  }
  if ($player['rightbghover'] != $default['rightbghover']) {
    $js_audio_settings .= 'rightbghover: "' . $player['rightbghover'] . '",';
  }
  if ($player['righticon'] != $default['righticon']) {
    $js_audio_settings .= 'righticon: "' . $player['righticon'] . '",';
  }
  if ($player['righticonhover'] != $default['righticonhover']) {
    $js_audio_settings .= 'righticonhover: "' . $player['righticonhover'] . '",';
  }
  if ($player['loader'] != $default['loader']) {
    $js_audio_settings .= 'loader: "' . $player['loader'] . '",';
  }
  if ($player['track'] != $default['track']) {
    $js_audio_settings .= 'track: "' . $player['track'] . '",';
  }
  if ($player['tracker'] != $default['tracker']) {
    $js_audio_settings .= 'tracker: "' . $player['tracker'] . '",';
  }
  if ($player['border'] != $default['border']) {
    $js_audio_settings .= 'border: "' . $player['border'] . '",';
  }
  if ($player['skip'] != $default['skip']) {
    $js_audio_settings .= 'skip: "' . $player['skip'] . '",';
  }
  if ($player['text'] != $default['text']) {
    $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);
  return $js_audio_settings;
}