function videojs_get_version in Video.js (HTML5 Video Player) 7.2
Same name and namespace in other branches
- 8 videojs.module \videojs_get_version()
- 6.2 videojs.module \videojs_get_version()
- 6 videojs.module \videojs_get_version()
- 7.3 videojs.module \videojs_get_version()
- 7 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 - Implements hook_requirements().
- videojs_settings_form_validate in includes/
videojs.admin.inc - Validation function to validate the videojs_settings_form() form.
File
- ./
videojs.module, line 345 - Provides an HTML5-compatible with Flash-fallback video player.
Code
function videojs_get_version($directory = NULL) {
$version = NULL;
if (!isset($directory)) {
$directory = variable_get('videojs_directory', 'sites/all/libraries/video-js');
}
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;
}