You are here

function theme_mediaelement_audio in MediaElement 7

Same name and namespace in other branches
  1. 7.2 mediaelement.module \theme_mediaelement_audio()

Implements theme_mediaelement_audio().

File

./mediaelement.module, line 108
Provides HTML5 video and audio elements using Mediaelement.js.

Code

function theme_mediaelement_audio($variables) {
  $output = '<div class="mediaelement-audio">';
  if (!empty($variables['settings']['description']) && !empty($variables['settings']['show_description']) && $variables['settings']['show_description'] != 'none') {
    $description_markup = '<p class="mediaelement-description">' . $variables['settings']['description'] . '</p>';
  }
  $output .= '<audio ' . drupal_attributes($variables['attributes']) . ' ></audio>';
  if (!empty($variables['settings']['show_description']) && $variables['settings']['show_description'] == 'above') {
    $output .= $description_markup;
  }
  if ($variables['settings']['download_link']) {
    $output .= '<div class="mediaelement-download-link"><a href="' . $variables['attributes']['src'] . '" download>' . filter_xss_admin($variables['settings']['download_text']) . '</a></div>';
  }
  if (!empty($variables['settings']['show_description']) && $variables['settings']['show_description'] == 'below') {
    $output .= $description_markup;
  }
  $output .= '</div>';
  return $output;
}