Bug #86934
closedNo rendering of audio files with "Text & Media" when they contain cover art
0%
Description
The issue https://forge.typo3.org/issues/86834 still exists.
It will work with simple mp3s, but not with files, that have cover art embedded, e.g. the windows example sounds. They are registered with file type "5".
Files
Updated by Jeff C about 6 years ago
- Related to Bug #86834: No rendering of audio files with "Text & Media" added
Updated by Jeff C about 6 years ago
- Related to Bug #71474: No rendering of audio files with "Text & Media" added
Updated by Guido Schmechel about 6 years ago
Can you add an example file?
I can't reproduce it with a test file and 9.5.1.
Updated by Jeff C about 6 years ago
- File Tchaikovsky_Rococo_Var_orch.mp3 Tchaikovsky_Rococo_Var_orch.mp3 added
- File 1914_Redon_Zyklop_anagoria.JPG 1914_Redon_Zyklop_anagoria.JPG added
- File Tchaikovsky_Rococo_Var_orch_IMAGE.mp3 Tchaikovsky_Rococo_Var_orch_IMAGE.mp3 added
I attached the three files, that I used for testing this on Typo3 9.5.1.
The original mp3 file works. Then I added the JPG as Cover Art to the mp3 file – now Typo3 will register it as an Image rather than an audio file.
Updated by Jonas Eberle about 6 years ago
Basically if you can make \TYPO3\CMS\Core\Resource\Rendering\AudioTagRenderer::canRender() (or your own implementation that is registered with \TYPO3\CMS\Core\Resource\Rendering\RendererRegistry::registerRendererClass() ) return true on that file it is rendered in an <audio> tag.
Normal filetype-sniffers report application/octet-stream on that file. So to achieve that it would need reading ID3-tags on those files.
EDIT: typo3/sysext/fluid_styled_content/Resources/Private/Partials/Media/Type.html would need adjustment, too. With the current type=5 (FILETYPE_APPLICATION) it never gets rendered as an audio file.
A minimal approach would be to react to application/octet-stream in \TYPO3\CMS\Core\Resource\Driver\LocalDriver::getSpecificFileInformation() and resolve to mimetype=audio/mpeg if some better content sniffer detects audio inside the file. This would set type=3 (audio).
Is this an edge case or are there other media file types that don't get well detected by TYPO3?
Updated by Jonas Eberle about 6 years ago
- Complexity deleted (
easy)
Just looked around and found that e.g. Symfony's https://github.com/symfony/http-foundation/blob/master/File/MimeType/FileinfoMimeTypeGuesser.php is in the same boat with PHP's finfo (and Unix's command "file" which also reports application/octet-stream in this case). "mp3 application/octet-stream" reveals some insight in that this is not trivial.
Played around with https://packagist.org/packages/james-heinrich/getid3 which correctly identifies the files as format MP3.
I as an audio nerd am all up to make TYPO3 a nice audio delivery platform, but I do not see this as a "Must have" in TYPO3 core.
Updated by Guido Schmechel over 5 years ago
With which tool do you add the cover art? I use https://www.mp3tag.de/ and i have no problems with this mp3 and image.
Updated by Susanne Moog over 4 years ago
- Status changed from New to Closed
Please use "$GLOBALS['TYPO3_CONF_VARS']['SYS']['FileInfo']['fileExtensionToMimeType']" setting in this case. To reliably natively identify all mp3 versions / mime-types is currently more or less impossible, and we have that configuration setting for exactly this kind of case.
(In addition, if you don't need the info from the ID3 tag you could also think about building a post-upload processor stripping the ID3 tags).