videojs.install in Video.js (HTML5 Video Player) 6.2
Same filename and directory in other branches
Installation file for Video.js module.
File
videojs.installView source
<?php
/**
* @file
* Installation file for Video.js module.
*/
/**
* Implementation of hook_requirements().
*/
function videojs_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
$requirements['videojs']['title'] = t('Video.js');
$videojs_version = videojs_get_version();
$dir = variable_get('videojs_directory', 'sites/all/libraries/video-js');
if ($videojs_version == NULL) {
$requirements['videojs']['value'] = t('Not found');
$requirements['videojs']['description'] = t('Missing the Video.js library. Please <a href="!url">download Video.js</a> and extract it into the %directory directory or any other suitable path for libraries.', array(
'!url' => url('http://videojs.com'),
'%directory' => $dir,
));
$requirements['videojs']['severity'] = REQUIREMENT_ERROR;
}
elseif (version_compare($videojs_version, '3', '<')) {
$requirements['videojs']['value'] = t('Unsupported version @version', array(
'@version' => $videojs_version,
));
$requirements['videojs']['description'] = t('The installed Video.js library is not supported. This version of the Video.js module only supports Video.js version 3. <a href="@videojs-url">Download Video.js version 3</a> and extract it into the %directory directory.', array(
'@videojs-url' => url('http://videojs.com'),
'%directory' => $dir,
));
$requirements['videojs']['severity'] = REQUIREMENT_ERROR;
}
else {
$requirements['videojs']['value'] = $videojs_version;
$requirements['videojs']['severity'] = REQUIREMENT_OK;
}
}
return $requirements;
}
/**
* Implementation of hook_uninstall().
*/
function videojs_uninstall() {
db_query("DELETE FROM {variable} WHERE name LIKE 'videojs_%%'");
}
/**
* Remove Flash related settings.
*/
function videojs_update_6200() {
variable_del('videojs_flowplayer_extraplayerheight');
variable_del('videojs_wmode');
variable_del('videojs_skin');
return array();
}
Functions
Name | Description |
---|---|
videojs_requirements | Implementation of hook_requirements(). |
videojs_uninstall | Implementation of hook_uninstall(). |
videojs_update_6200 | Remove Flash related settings. |