Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / file / src / Plugin / Field / FieldFormatter / FileAudioFormatter.php
diff --git a/web/core/modules/file/src/Plugin/Field/FieldFormatter/FileAudioFormatter.php b/web/core/modules/file/src/Plugin/Field/FieldFormatter/FileAudioFormatter.php
new file mode 100644 (file)
index 0000000..970ba16
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+namespace Drupal\file\Plugin\Field\FieldFormatter;
+
+/**
+ * Plugin implementation of the 'file_audio' formatter.
+ *
+ * @FieldFormatter(
+ *   id = "file_audio",
+ *   label = @Translation("Audio"),
+ *   description = @Translation("Display the file using an HTML5 audio tag."),
+ *   field_types = {
+ *     "file"
+ *   }
+ * )
+ */
+class FileAudioFormatter extends FileMediaFormatterBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function getMediaType() {
+    return 'audio';
+  }
+
+}