You are here

function jplayer_get_file_path in jPlayer 6

Returns path to the most appropriate file

Parameters

$filename: Name of the file to find

$required_files: Other files required in target folder

1 call to jplayer_get_file_path()
jplayer_add in ./jplayer.module
Add the jPlayer library to the page.

File

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

Code

function jplayer_get_file_path($filename, $required_files = array()) {
  global $theme;
  $theme_dir = drupal_get_path('theme', $theme) . '/jplayer/';
  $found = false;
  if (file_exists($path = $theme_dir . $filename)) {
    $found = true;
    foreach ($required_files as $key => $value) {
      if (!file_exists($theme_dir . $value)) {
        $found = false;
        break;
      }
    }
  }
  return $found ? $path : drupal_get_path('module', 'jplayer') . '/theme/' . $filename;
}