From 94c426bd971a40771e8a3503af3eafd01cc89c73 Mon Sep 17 00:00:00 2001 From: advplyr Date: Fri, 10 Apr 2026 16:42:39 -0500 Subject: [PATCH] Update comments on matroska --- client/players/LocalAudioPlayer.js | 16 +++++++++++----- server/utils/constants.js | 2 ++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/client/players/LocalAudioPlayer.js b/client/players/LocalAudioPlayer.js index 377818089..a0384d54d 100644 --- a/client/players/LocalAudioPlayer.js +++ b/client/players/LocalAudioPlayer.js @@ -47,12 +47,18 @@ export default class LocalAudioPlayer extends EventEmitter { 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', - // `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`. + '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 the server still uses `audio/x-matroska` // ref: https://www.iana.org/assignments/media-types/media-types.xhtml - 'audio/matroska', 'audio/x-matroska' + 'audio/matroska', + 'audio/x-matroska' ] var mimeTypeCanPlayMap = {} mimeTypes.forEach((mt) => { diff --git a/server/utils/constants.js b/server/utils/constants.js index cc5217f41..925035e17 100644 --- a/server/utils/constants.js +++ b/server/utils/constants.js @@ -48,6 +48,8 @@ module.exports.AudioMimeType = { AIF: 'audio/x-aiff', WEBM: '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', AWB: 'audio/amr-wb', CAF: 'audio/x-caf',