You are here

function mp3player_player_settings in MP3 Player 7.2

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

Returns a string of audio player settings.

Parameters

int $pid of the player. Defaults to 1 (default player):

Return value

string

1 call to mp3player_player_settings()
theme_mp3player in ./mp3player.module
Setup theme function for the MP3 Player.
1 string reference to 'mp3player_player_settings'
mp3player_player_form_submit in ./mp3player.module
Add a new player.

File

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

Code

function mp3player_player_settings($pid = 1) {
  $player_cache =& drupal_static(__FUNCTION__, array());
  if (!isset($player_cache[$pid])) {
    $player = mp3player_players($pid);
    if ($player['pagebg'] == '') {
      $player['pagebg'] = FALSE;
    }
    $encode = json_encode($player);
    $player_cache[$pid] = $encode;
  }
  $settings = $player_cache[$pid];
  $js_audio_settings = 'AudioPlayer.setup("/' . libraries_get_path('audio-player') . '/player.swf", ';
  $js_audio_settings .= $settings;
  $js_audio_settings .= ');';
  return $js_audio_settings;
}