function mediaelement_init in MediaElement 6
Same name and namespace in other branches
- 7.2 mediaelement.module \mediaelement_init()
- 7 mediaelement.module \mediaelement_init()
Implementation of hook_init().
File
- ./
mediaelement.module, line 34 - Provide support for MediaElement.js to the entire site of just Filefield.
Code
function mediaelement_init() {
// When the media player is set to be on all pages add it to the page.
if (variable_get('mediaelement_sitewide', FALSE)) {
$path = libraries_get_path('mediaelement');
drupal_add_js($path . '/src/mediaelement.js');
drupal_add_js($path . '/src/mediaelementplayer.js');
drupal_add_js(array(
'mediaelement' => array(
'all' => TRUE,
),
), 'setting');
drupal_add_js(drupal_get_path('module', 'mediaelement') . '/mediaelement.js');
drupal_add_css($path . '/src/mediaelementplayer.css');
}
}