<?php

/**
 * Implements hook_audio_player_theme_registry_alter().
 */
function mkbh_audio_player_theme_registry_alter(&$theme_registry) {
  $theme_registry['jplayer']['template'] = drupal_get_path('module', 'mkbh_audio_player') . '/theme/jplayer';
}

/**
 * Implements hook_css_alter().
 */
function mkbh_audio_player_css_alter(&$css) {
  $jplayer_css_path = drupal_get_path('module', 'jplayer') . '/theme/jplayer.css';

  if (isset ($css[$jplayer_css_path])) {
    unset ($css[$jplayer_css_path]);
  }
}

/**
 * Implements HOOK_preprocess_hook().
 */
function mkbh_audio_player_preprocess_jplayer(&$vars) {
  $module_path = drupal_get_path('module', 'mkbh_audio_player');

  drupal_add_css($module_path . '/theme/jplayer.less');
  drupal_add_css($module_path . '/theme/mkbh_audio_player.layout.less');
  drupal_add_js($module_path . '/theme/jplayer.extend.js');
}