Update comments on matroska

This commit is contained in:
advplyr 2026-04-10 16:42:39 -05:00
parent 522b9735e2
commit 94c426bd97
2 changed files with 13 additions and 5 deletions

View file

@ -47,12 +47,18 @@ export default class LocalAudioPlayer extends EventEmitter {
this.player.addEventListener('timeupdate', this.evtTimeupdate.bind(this)) this.player.addEventListener('timeupdate', this.evtTimeupdate.bind(this))
var mimeTypes = [ var mimeTypes = [
'audio/flac', 'audio/mpeg', 'audio/mp4', 'audio/ogg', 'audio/aac', 'audio/flac',
'audio/x-ms-wma', 'audio/x-aiff', 'audio/webm', 'audio/mpeg',
// `audio/matroska` is the correct mimetype, but at least as of 2026-04-09, 'audio/mp4',
// the detected mimetype for matroska files by the server is `audio/x-matroska`. 'audio/ogg',
'audio/aac',
'audio/x-ms-wma',
'audio/x-aiff',
'audio/webm',
// `audio/matroska` is the correct mimetype, but the server still uses `audio/x-matroska`
// ref: https://www.iana.org/assignments/media-types/media-types.xhtml // ref: https://www.iana.org/assignments/media-types/media-types.xhtml
'audio/matroska', 'audio/x-matroska' 'audio/matroska',
'audio/x-matroska'
] ]
var mimeTypeCanPlayMap = {} var mimeTypeCanPlayMap = {}
mimeTypes.forEach((mt) => { mimeTypes.forEach((mt) => {

View file

@ -48,6 +48,8 @@ module.exports.AudioMimeType = {
AIF: 'audio/x-aiff', AIF: 'audio/x-aiff',
WEBM: 'audio/webm', WEBM: 'audio/webm',
WEBMA: 'audio/webm', WEBMA: 'audio/webm',
// TODO: Switch to `audio/matroska`? marked as deprecated in IANA registry
// ref: https://datatracker.ietf.org/doc/html/rfc9559
MKA: 'audio/x-matroska', MKA: 'audio/x-matroska',
AWB: 'audio/amr-wb', AWB: 'audio/amr-wb',
CAF: 'audio/x-caf', CAF: 'audio/x-caf',