diff --git a/file_entity.field.inc b/file_entity.field.inc index 43016ff..50eeb46 100644 --- a/file_entity.field.inc +++ b/file_entity.field.inc @@ -15,6 +15,18 @@ function file_entity_field_formatter_info() { 'field types' => array('file', 'image'), 'settings' => array('file_view_mode' => 'default'), ); + $info['file_audio'] = array( + 'label' => t('Audio'), + 'description' => t('Render the file using an HTML5 audio tag'), + 'field types' => array('file'), + 'settings' => array('controls' => TRUE, 'multiple_file_behaviour' => 'sources'), + ); + $info['file_video'] = array( + 'label' => t('Video'), + 'description' => t('Render the file using an HTML5 video tag'), + 'field types' => array('file'), + 'settings' => array('controls' => TRUE, 'multiple_file_behaviour' => 'sources'), + ); return $info; } @@ -35,7 +47,40 @@ function file_entity_field_formatter_settings_form($field, $instance, $view_mode // Never empty, so no #empty_option ); } + else if ($display['type'] == 'file_audio') { + $element['controls'] = array( + '#title' => t('Show audio controls'), + '#type' => 'checkbox', + '#default_value' => isset($settings['controls']) ? $settings['controls'] : TRUE, + ); + $element['multiple_file_behaviour'] = array( + '#title' => t('Display of multiple files'), + '#type' => 'radios', + '#options' => array( + 'sources' => t('Use multiple sources within a single