Skip to content

Audio Files and MIME Types

Thomas Marx edited this page Apr 8, 2017 · 25 revisions

To play all audio formats supported by Audio Player, it can be necessary to add unknown formats to ownCloud/Nextcloud. The formats .m4a and .m4b were added in ownCloud/Nextcloud 9.1.0.

Add Custom MIME Types

By default ownCloud/Nextcloud is distributed with resources/config/mimetypemapping.dist.json. Do not modify this file, as it will be replaced when ownCloud/Nextcloud is updated. Instead, create your own config/mimetypemapping.json file and add your own MIME types.

After that you have to update the table *PREFIX*mimetypes with the newly added MIME types and correct the file mappings in the table *PREFIX*filecache with occ command ./occ maintenance:mimetype:update-db --repair-filecache as well as the core/js/mimetypelist.js with command ./occ maintenance:mimetype:update-js.

Content of mimetypemapping.json

{
	…
	"m4a": ["audio/mp4"],
	"m4b": ["audio/mp4"],
	"mp3": ["audio/mpeg"],
	"ogg": ["audio/ogg"],
	"opus": ["audio/ogg"],
	"wav": ["audio/wav"],
}

Not yet supported by Audio Player

{
	…
	"flac": ["audio/flac"],
	"m3u": ["audio/mpegurl", "text/plain"],
	"m3u8": ["audio/mpegurl", "text/plain"],
	"pls": ["audio/x-scpls", "text/plain"],
	"xspf": ["application/xspf+xml", "text/plain"],
}

Browser Support

To be continued …

Clone this wiki locally