You are here

function _jplayer_get_js in jPlayer 7.2

Finds the JS file available in the libraries directory.

Return value

string|bool Full file path or FALSE on failure.

2 calls to _jplayer_get_js()
jplayer_get_version in ./jplayer.module
Return the version of jPlayer installed.
jplayer_library in ./jplayer.module
Implements hook_library().

File

./jplayer.module, line 442
Provides an HTML5-compatible with Flash-fallback audio player.

Code

function _jplayer_get_js() {
  $path = libraries_get_path('jplayer');
  $player_files = array(
    'min' => '/jquery.jplayer.min.js',
    'full' => '/jquery.jplayer.js',
  );

  // Check main library directory.
  foreach ($player_files as $type => $file) {
    $return = $path . $file;
    if (file_exists($return)) {
      return $return;
    }
  }

  // If they just unzipped the dl, the file is in the dist/jplayer folder.
  $path .= '/dist/jplayer';
  foreach ($player_files as $file) {
    $return = $path . $file;
    if (file_exists($return)) {
      return $return;
    }
  }
  return FALSE;
}