mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-04-17 12:39:42 +00:00
Merge pull request #5115 from rktjmp/fix-mka-opus-desktop-streaming
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Run Component Tests / Run Component Tests (push) Has been cancelled
Build and Push Docker Image / build (push) Has been cancelled
Integration Test / build and test (push) Has been cancelled
Run Unit Tests / Run Unit Tests (push) Has been cancelled
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Run Component Tests / Run Component Tests (push) Has been cancelled
Build and Push Docker Image / build (push) Has been cancelled
Integration Test / build and test (push) Has been cancelled
Run Unit Tests / Run Unit Tests (push) Has been cancelled
Force AAC transcode when streaming mka+opus to desktop client
This commit is contained in:
commit
88667d00a1
3 changed files with 17 additions and 2 deletions
|
|
@ -46,7 +46,20 @@ export default class LocalAudioPlayer extends EventEmitter {
|
||||||
this.player.addEventListener('loadedmetadata', this.evtLoadedMetadata.bind(this))
|
this.player.addEventListener('loadedmetadata', this.evtLoadedMetadata.bind(this))
|
||||||
this.player.addEventListener('timeupdate', this.evtTimeupdate.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 the server still uses `audio/x-matroska`
|
||||||
|
// ref: https://www.iana.org/assignments/media-types/media-types.xhtml
|
||||||
|
'audio/matroska',
|
||||||
|
'audio/x-matroska'
|
||||||
|
]
|
||||||
var mimeTypeCanPlayMap = {}
|
var mimeTypeCanPlayMap = {}
|
||||||
mimeTypes.forEach((mt) => {
|
mimeTypes.forEach((mt) => {
|
||||||
var canPlay = this.player.canPlayType(mt)
|
var canPlay = this.player.canPlayType(mt)
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ class Stream extends EventEmitter {
|
||||||
return [AudioMimeType.FLAC, AudioMimeType.OPUS, AudioMimeType.WMA, AudioMimeType.AIFF, AudioMimeType.WEBM, AudioMimeType.WEBMA, AudioMimeType.AWB, AudioMimeType.CAF]
|
return [AudioMimeType.FLAC, AudioMimeType.OPUS, AudioMimeType.WMA, AudioMimeType.AIFF, AudioMimeType.WEBM, AudioMimeType.WEBMA, AudioMimeType.AWB, AudioMimeType.CAF]
|
||||||
}
|
}
|
||||||
get codecsToForceAAC() {
|
get codecsToForceAAC() {
|
||||||
return ['alac', 'ac3', 'eac3']
|
return ['alac', 'ac3', 'eac3', 'opus']
|
||||||
}
|
}
|
||||||
get userToken() {
|
get userToken() {
|
||||||
return this.user.token
|
return this.user.token
|
||||||
|
|
|
||||||
|
|
@ -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',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue