You are here

function jplayer_protect_jplayer_add_js in jPlayer 6

Same name and namespace in other branches
  1. 7.2 jplayer_protect/jplayer_protect.module \jplayer_protect_jplayer_add_js()

Implements hook_jplayer_add_js().

File

jplayer_protect/jplayer_protect.module, line 180
Provides basic content protection for media files accessed with jPlayer.

Code

function jplayer_protect_jplayer_add_js() {
  if (!variable_get('jplayer_protect', FALSE)) {
    return;
  }
  $settings = array(
    'jPlayer' => array(
      'protect' => variable_get('jplayer_protect', FALSE),
    ),
  );
  drupal_add_js($settings, 'setting');
  return array(
    'jplayer_protect' => array(
      '#attached' => array(
        'js' => array(
          drupal_get_path('module', 'jplayer_protect') . '/jplayer-protect.js' => array(
            'type' => 'module',
            'scope' => 'footer',
          ),
        ),
      ),
    ),
  );
}