You are here

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

Same name and namespace in other branches
  1. 8 videojs.module \videojs_get_version()
  2. 6 videojs.module \videojs_get_version()
  3. 7.3 videojs.module \videojs_get_version()
  4. 7 videojs.module \videojs_get_version()
  5. 7.2 videojs.module \videojs_get_version()

Return the version of Video.js installed.

Parameters

$directory: The directory to check for a Video.js installation.

2 calls to videojs_get_version()
videojs_requirements in ./videojs.install
Implementation of hook_requirements().
videojs_settings_form_validate in includes/videojs.admin.inc
Validation function to validate the videojs_settings_form() form.

File

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

Code

function videojs_get_version($directory = NULL) {
  $version = NULL;
  if (!isset($directory)) {
    $directory = videojs_get_path();
  }
  if (!file_exists($directory . '/video.js')) {
    return NULL;
  }
  $contents = file_get_contents($directory . '/video.js');
  $matches = array();
  if (preg_match('/(?:v[ ]*|Version )([\\d.]+)/i', $contents, $matches)) {
    $version = $matches[1];
  }
  return $version;
}