grav icon indicating copy to clipboard operation
grav copied to clipboard

Feature Request: Add FLAC and AAC as media types

Open suterma opened this issue 2 years ago • 1 comments

In config/media, many file types are included by default, including audio files, like e.g. MP3. I suggest that you also add FLAC and AAC files there since these are also popular file types.

suterma avatar May 01 '22 21:05 suterma

Additionally, I suggest that these are also added in the media player handler mentioned here: https://learn.getgrav.org/17/content/media#audio-actions

Currently, these files do not produce an audio element, even when added to the configuration media.

suterma avatar May 01 '22 21:05 suterma

Hi @suterma In fact Grav has support for those types of audio files, you just have to add the extensions in config/media.yaml, as follows:

flac:
     type: audio
     thumb: media/thumb-fla.png
     mime: audio/flac
     image:null
aac:
     type: audio
     thumb: media/thumb-aac.png
     mime: audio/aac
     image:null

Then on your page load the audio files and call them from the page editor. Here I show you a screenshot (and I can assure you that the audio plays)

Flac sample

![sample3.flac](sample3.flac)

AAC sample

![sample3.aac](sample3.aac)

flac_aac_grav

pmoreno-rodriguez avatar Feb 16 '24 22:02 pmoreno-rodriguez

Thanks @pmoreno-rodriguez for coming back to me. It now works, however, I had also one more problem to fix: I forgot the exclamation mark in front of the FLAC-link:

DID NOT WORK: [FLAC](8%20-%20Truth.flac?preload=metadata) DOES WORK: ![FLAC](8%20-%20Truth.flac?preload=metadata)

suterma avatar Feb 18 '24 18:02 suterma