Full ELMS Learning Network documentation
function theme_file_entity_file_audio
×
Error message
User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).cis7 file_entity.theme.inc | theme_file_entity_file_audio($variables) |
cle7 file_entity.theme.inc | theme_file_entity_file_audio($variables) |
elmsmedia7 file_entity.theme.inc | theme_file_entity_file_audio($variables) |
icor7 file_entity.theme.inc | theme_file_entity_file_audio($variables) |
meedjum_blog7 file_entity.theme.inc | theme_file_entity_file_audio($variables) |
mooc7 file_entity.theme.inc | theme_file_entity_file_audio($variables) |
Returns HTML for displaying an HTML5 <audio> tag.
Parameters
array $variables: An associative array containing:
- file: Associative array of file data, which must include "uri".
- controls: Boolean indicating whether or not controls should be displayed.
- autoplay: Boolean indicating whether or not the audio should start playing automatically.
- loop: Boolean indicating whether or not the audio should loop.
Related topics
2 string references to the theme hook from theme_file_entity_file_audio()
Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.
- file_entity_field_formatter_view in sites/
all/ modules/ ulmus/ file_entity/ file_entity.field.inc - Implements hook_field_formatter_view().
- file_entity_theme in sites/
all/ modules/ ulmus/ file_entity/ file_entity.module - Implements hook_theme().
File
- sites/
all/ modules/ ulmus/ file_entity/ file_entity.theme.inc, line 85 - Theme callbacks for the file entity module.
Code
function theme_file_entity_file_audio($variables) {
$files = $variables['files'];
$output = '';
$audio_attributes = array();
if ($variables['controls']) {
$audio_attributes['controls'] = 'controls';
}
if ($variables['autoplay']) {
$audio_attributes['autoplay'] = 'autoplay';
}
if ($variables['loop']) {
$audio_attributes['loop'] = 'loop';
}
$output .= '<audio' . drupal_attributes($audio_attributes) . '>';
foreach ($files as $delta => $file) {
$source_attributes = array(
'src' => file_create_url($file['uri']),
'type' => $file['filemime'],
);
$output .= '<source' . drupal_attributes($source_attributes) . ' />';
}
$output .= '</audio>';
return $output;
}