Add:Support for webm and webma audio files #1079

This commit is contained in:
advplyr 2022-10-20 17:24:51 -05:00
parent 4ea1e4460a
commit f55559e9a3
5 changed files with 9 additions and 5 deletions

View File

@ -46,7 +46,7 @@ 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']
var mimeTypes = ['audio/flac', 'audio/mpeg', 'audio/mp4', 'audio/ogg', 'audio/aac', 'audio/x-ms-wma', 'audio/x-aiff', 'audio/webm']
var mimeTypeCanPlayMap = {}
mimeTypes.forEach((mt) => {
var canPlay = this.player.canPlayType(mt)

View File

@ -1,6 +1,6 @@
const SupportedFileTypes = {
image: ['png', 'jpg', 'jpeg', 'webp'],
audio: ['m4b', 'mp3', 'm4a', 'flac', 'opus', 'ogg', 'oga', 'mp4', 'aac', 'wma', 'aiff', 'wav'],
audio: ['m4b', 'mp3', 'm4a', 'flac', 'opus', 'ogg', 'oga', 'mp4', 'aac', 'wma', 'aiff', 'wav', 'webm', 'webma'],
ebook: ['epub', 'pdf', 'mobi', 'azw3', 'cbr', 'cbz'],
info: ['nfo'],
text: ['txt'],

View File

@ -73,7 +73,9 @@ class Stream extends EventEmitter {
AudioMimeType.FLAC,
AudioMimeType.OPUS,
AudioMimeType.WMA,
AudioMimeType.AIFF
AudioMimeType.AIFF,
AudioMimeType.WEBM,
AudioMimeType.WEBMA
]
}
get userToken() {

View File

@ -44,7 +44,9 @@ module.exports.AudioMimeType = {
AAC: 'audio/aac',
FLAC: 'audio/flac',
WMA: 'audio/x-ms-wma',
AIFF: 'audio/x-aiff'
AIFF: 'audio/x-aiff',
WEBM: 'audio/webm',
WEBMA: 'audio/webm'
}
module.exports.VideoMimeType = {

View File

@ -1,6 +1,6 @@
const globals = {
SupportedImageTypes: ['png', 'jpg', 'jpeg', 'webp'],
SupportedAudioTypes: ['m4b', 'mp3', 'm4a', 'flac', 'opus', 'ogg', 'oga', 'mp4', 'aac', 'wma', 'aiff', 'wav'],
SupportedAudioTypes: ['m4b', 'mp3', 'm4a', 'flac', 'opus', 'ogg', 'oga', 'mp4', 'aac', 'wma', 'aiff', 'wav', 'webm', 'webma'],
SupportedEbookTypes: ['epub', 'pdf', 'mobi', 'azw3', 'cbr', 'cbz'],
SupportedVideoTypes: ['mp4'],
TextFileTypes: ['txt', 'nfo'],