You are here

function mediaelement_init in MediaElement 7.2

Same name and namespace in other branches
  1. 6 mediaelement.module \mediaelement_init()
  2. 7 mediaelement.module \mediaelement_init()

Implements hook_init().

File

./mediaelement.module, line 78
Provides HTML5 video and audio elements using Mediaelement.js for HTML4 browsers.

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)) {
    drupal_add_library('mediaelement', 'mediaelement');
    drupal_add_js(drupal_get_path('module', 'mediaelement') . '/mediaelement.js');
    drupal_add_js(array(
      'mediaelementAll' => TRUE,
    ), array(
      'type' => 'setting',
    ));
  }
}