You are here

function swftools_flowplayer3_add_js in SWF Tools 6.3

Attaches Flowplayer 3 JavaScripts and CSS to the page.

Return value

Nothing.

3 calls to swftools_flowplayer3_add_js()
swftools_flowplayer3_init in flowplayer3/swftools_flowplayer3.module
Implementation of hook_init().
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 649
Enables SWF Tools support for Flowplayer 3.

Code

function swftools_flowplayer3_add_js() {

  // Add accessibility and auto start/stop functions
  drupal_add_js(drupal_get_path('module', 'swftools_flowplayer3') . '/swftools_flowplayer3.js');

  // If Flowplayer 3 embedding is active then put this in place too
  if (variable_get('swftools_flowplayer3_embed', FALSE)) {

    // Get the path to the library
    $library = swftools_get_library('flowplayer3');

    // Add CSS to ensure container is set as block and to implement playlist styles
    drupal_add_css(drupal_get_path('module', 'swftools_flowplayer3') . '/swftools_flowplayer3.css');

    // Add Flowplayer 3 embedding script
    drupal_add_js($library . '/' . variable_get('swftools_flowplayer3_javascript', SWFTOOLS_FLOWPLAYER3_JAVASCRIPT));

    // Add Flowplayer 3 playlist script in case a profile wants to use it
    drupal_add_js(drupal_get_path('module', 'swftools_flowplayer3') . '/swftools_flowplayer3.playlist.js');

    // Add scrollable script it is required
    if (variable_get('swftools_flowplayer3_scrollable_script', 0)) {
      drupal_add_js($library . '/' . variable_get('swftools_flowplayer3_scrollable_javascript', SWFTOOLS_FLOWPLAYER3_SCROLLABLE_JAVASCRIPT));
    }
  }
}