neos / flow-development-collection

The unified repository containing the Flow core packages, used for Flow development.
https://flow.neos.io/
MIT License
139 stars 188 forks source link

FEATURE: Add new mime types to known media types #3073

Open alexander-nitsche opened 1 year ago

alexander-nitsche commented 1 year ago

Is there an existing issue for this?

Description

1. File extension .vtt => text/vtt

WebVTT seems to be on the way to become a web standard in HTML video subtitles [1]. Its mime type is "text/vtt", its file extension ".vtt". It is already included in other public mime type libraries like the node package "mime" [2].

[1] https://developer.mozilla.org/en-US/docs/Web/API/WebVTT_API [2] https://github.com/broofa/mime/blob/main/types/standard.js#L315

2. File extension .opus => audio/ogg or audio/ogg; codecs=opus

The Opus audio codec was approved by the IETF in 2012 and seems to be a successor of MP3 and Vorbis and even AAC. Mostly included in the OGG container, its file extension is ".opus" and its mime type is generally "audio/ogg" and specifically "audio/ogg; codecs=opus" [1], both of which are approved via the native Javascript HTMLMediaElement.canPlayType method [2] of Chromium, Firefox and Vivaldi (at least the ones I checked). My first contact with this format was via the Debian 10 "Bullseye" Gnome app "Sound Recorder", which offered four audio formats: OGG Vorbis, OGG Opus, MP3 and FLAC.

[1] https://datatracker.ietf.org/doc/html/rfc7845#section-9 [2] https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType

3. File extension .flac => audio/flac instead of deprecated audio/x-flac

The FLAC codec is a lossless audio codec, widely supported by OSs, browsers [1] and listed by Mozilla as one of the common web audio codecs [2], including being free to use without any licensing fees. Its file extension is ".flac" and its mime type is "audio/flac" [3]. It was previously "audio/x-flac" which is considered deprecated now, and which does not work with the browsers HTMLMediaElement.canPlayType method, for example.

[1] https://caniuse.com/flac [2] https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Audio_codecs#common_codecs [3] https://en.wikipedia.org/wiki/FLAC

Possible Solution

I suggest to add or update the mime types to the media type class [1] in all maintained Flow Framework branches.

[1] https://github.com/neos/flow-development-collection/blob/8.3/Neos.Utility.MediaTypes/Classes/MediaTypes.php

alexander-nitsche commented 1 year ago

I would push a PR if i could. Seem to require permissions ..

alexander-nitsche commented 1 year ago

Added a second desired mapping .opus => audio/ogg or audio/ogg; codecs=opus.

alexander-nitsche commented 1 year ago

Added the desired mapping update for file extension .flac.