mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-04-15 19:49:43 +00:00
Add audio/(x-)matroska to client player MIME types to avoid transcode
Firefox, at least, supports playing `matroska/audio` containers natively but the client was not checking for support. Clients that do not support playing `matroska/audio` containers will fallback to transcoding.
This commit is contained in:
parent
d9355ac3aa
commit
522b9735e2
1 changed files with 8 additions and 1 deletions
|
|
@ -46,7 +46,14 @@ export default class LocalAudioPlayer extends EventEmitter {
|
|||
this.player.addEventListener('loadedmetadata', this.evtLoadedMetadata.bind(this))
|
||||
this.player.addEventListener('timeupdate', this.evtTimeupdate.bind(this))
|
||||
|
||||
var mimeTypes = ['audio/flac', 'audio/mpeg', 'audio/mp4', 'audio/ogg', 'audio/aac', 'audio/x-ms-wma', 'audio/x-aiff', 'audio/webm']
|
||||
var mimeTypes = [
|
||||
'audio/flac', 'audio/mpeg', 'audio/mp4', 'audio/ogg', 'audio/aac',
|
||||
'audio/x-ms-wma', 'audio/x-aiff', 'audio/webm',
|
||||
// `audio/matroska` is the correct mimetype, but at least as of 2026-04-09,
|
||||
// the detected mimetype for matroska files by the server is `audio/x-matroska`.
|
||||
// ref: https://www.iana.org/assignments/media-types/media-types.xhtml
|
||||
'audio/matroska', 'audio/x-matroska'
|
||||
]
|
||||
var mimeTypeCanPlayMap = {}
|
||||
mimeTypes.forEach((mt) => {
|
||||
var canPlay = this.player.canPlayType(mt)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue