You are here

function videojs_get_path in Video.js (HTML5 Video Player) 6.2

Same name and namespace in other branches
  1. 6 videojs.module \videojs_get_path()
  2. 7.3 videojs.module \videojs_get_path()

Get the path to the video.js external library.

Return value

The path to the directory where video.js library is located.

2 calls to videojs_get_path()
videojs_add in ./videojs.module
Add the Video.js library to the page.
videojs_get_version in ./videojs.module
Return the version of Video.js installed.

File

./videojs.module, line 81
Provides an HTML5-compatible with Flash-fallback video player.

Code

function videojs_get_path() {

  // Default directory path.
  $directory = 'sites/all/libraries/video-js';

  // Libraries API integration - In case VideoJS library is in multiple
  // locations (profiles/{profile_name}/libraries, sites/all/libraries,
  // sites{site_name}/libraries ) Libraries API can determine which copy should
  // take presidence...
  if (module_exists('libraries') && ($libraries_dir = libraries_get_path('video-js'))) {
    if (file_exists($libraries_dir . '/video.js')) {
      $directory = $libraries_dir;
    }
  }

  // ...However, we also give the user the opportunity to override the path.
  if ($conf_dir = variable_get('videojs_directory', NULL)) {
    if (file_exists($conf_dir . '/video.js')) {
      $directory = $conf_dir;
    }
  }
  return $directory;
}