You are here

function audiofield_soundmanager2_360player in AudioField 7

Callback function for AudioField SoundManager2 360 player.

1 string reference to 'audiofield_soundmanager2_360player'
audiofield_players in ./audiofield.players.inc
Implements hook_audiofield_players().

File

./audiofield.players.inc, line 328
Declares the available audio players for the Audio Field module.

Code

function audiofield_soundmanager2_360player($player_path, $audio_file) {
  $player_base_path = variable_get('audiofield_players_dir', 'sites/all/libraries/player') . "/soundmanager2";
  $ie_js = array(
    '#type' => 'markup',
    '#markup' => '<!--[if IE]><script type="text/javascript" src="' . $player_path . '/demo/360-player/script/excanvas.js"></script><![endif]-->',
  );
  drupal_add_html_head($ie_js, 'audiofield');
  drupal_add_js($player_base_path . '/script/soundmanager2.js', array(
    'weight' => 0,
  ));

  // Add 360 viewer javascript.
  drupal_add_js($player_base_path . '/demo/360-player/script/berniecode-animator.js', array(
    'weight' => 1,
  ));
  drupal_add_js($player_base_path . '/demo/360-player/script/360player.js', array(
    'weight' => 1,
  ));
  drupal_add_css($player_base_path . '/demo/360-player/360player.css');

  // Pass settings to builder.
  drupal_add_js(array(
    'audiofield' => array(
      'swf_path' => $player_path . '/swf',
    ),
  ), array(
    'type' => 'setting',
  ));

  // Add the builder javascript.
  drupal_add_js(drupal_get_path('module', 'audiofield') . '/js/soundmanager2-360player.builder.js', array(
    'type' => 'file',
    'scope' => 'footer',
    'weight' => 10,
  ));
  return theme('audiofield_players_soundmanager2_360player', array(
    'id' => drupal_html_id('sm2-container-real'),
    'audio_file' => file_create_url($audio_file),
  ));
}