You are here

mediaelement.module in MediaElement 6

Same filename and directory in other branches
  1. 8 mediaelement.module
  2. 7.2 mediaelement.module
  3. 7 mediaelement.module

Provide support for MediaElement.js to the entire site of just Filefield.

File

mediaelement.module
View source
<?php

/**
 * @file
 * Provide support for MediaElement.js to the entire site of just Filefield.
 */

/**
 * Implementation of hook_menu().
 */
function mediaelement_menu() {
  return array(
    'admin/settings/mediaelement' => array(
      'title' => 'MediaElement.js',
      'description' => 'Settings for MediaElement.js integration with Drupal',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'mediaelement_admin_form',
      ),
      'access arguments' => array(
        'administer MediaElement',
      ),
      'file' => 'mediaelement.admin.inc',
    ),
  );
}

/**
 * Implementation of hook_perm().
 */
function mediaelement_perm() {
  return array(
    'administer MediaElement',
  );
}

/**
 * Implementation of hook_init().
 */
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');
  }
}

Functions

Namesort descending Description
mediaelement_init Implementation of hook_init().
mediaelement_menu Implementation of hook_menu().
mediaelement_perm Implementation of hook_perm().