Skip to content

Audio Files and MIME Types

Thomas Marx edited this page Nov 17, 2017 · 25 revisions

To play all audio formats supported by Audio Player, it can be necessary to add unknown formats to Nextcloud and ownCloud. Playing the formats supported by Audio Player depends on the browser.

Add Custom MIME Types

By default Nextcloud and ownCloud are distributed with resources/config/mimetypemapping.dist.json. Do not modify this file, as it will be replaced when Nextcloud or ownCloud 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

{
	"flac": ["audio/flac"],
	"m3u": ["audio/mpegurl", "text/plain"],
	"m3u8": ["audio/mpegurl", "text/plain"],
	"m4a": ["audio/mp4"],
	"m4b": ["audio/mp4"],
	"mp3": ["audio/mpeg"],
	"ogg": ["audio/ogg"],
	"opus": ["audio/ogg"],
	"pls": ["audio/x-scpls", "text/plain"],
	"wav": ["audio/wav"]
}

Not yet supported by Audio Player

{
	"webm": ["audio/webm"],
	"wma": ["audio/x-ms-wma"],
	"xspf": ["application/xspf+xml", "text/plain"]
}

Browser Support

To evaluate your browser capabilities, go to the personal settings of your cloud and select the Audio Player section. It will show the MIME types depending on your current browser.
In case your browser does not support a MIME type which is indexed by Audio Player, the title is still shown in playlists, will be highlighted in a different font style and can not be played. On the sharing page you will see a hint about the unsupported MIME type instead of the Share Player.
Displaying of the embedded cover art – especially on the sharing page – depends on the preview function of the cloud and the graphics capabilities of the server.

Clone this wiki locally