mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-01-01 00:29:38 +00:00
Add:Start/complete date on audiobook page #383, Fix local hls stream url
This commit is contained in:
parent
408775a25a
commit
95bacce5e5
3 changed files with 26 additions and 7 deletions
|
|
@ -16,4 +16,14 @@ export default class AudioTrack {
|
|||
}
|
||||
return `${window.location.origin}${this.contentUrl}`
|
||||
}
|
||||
|
||||
get relativeContentUrl() {
|
||||
if (!this.contentUrl || this.contentUrl.startsWith('http')) return this.contentUrl
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
return `${process.env.serverUrl}${this.contentUrl}`
|
||||
}
|
||||
|
||||
return this.contentUrl
|
||||
}
|
||||
}
|
||||
|
|
@ -99,7 +99,7 @@ export default class LocalPlayer extends EventEmitter {
|
|||
if (!Hls.isSupported()) {
|
||||
console.warn('HLS is not supported - fallback to using audio element')
|
||||
this.usingNativeplayer = true
|
||||
this.player.src = this.currentTrack.contentUrl
|
||||
this.player.src = this.currentTrack.relativeContentUrl
|
||||
this.player.currentTime = this.currentTime
|
||||
return
|
||||
}
|
||||
|
|
@ -115,7 +115,7 @@ export default class LocalPlayer extends EventEmitter {
|
|||
|
||||
this.hlsInstance.attachMedia(this.player)
|
||||
this.hlsInstance.on(Hls.Events.MEDIA_ATTACHED, () => {
|
||||
this.hlsInstance.loadSource(this.currentTrack.contentUrl)
|
||||
this.hlsInstance.loadSource(this.currentTrack.relativeContentUrl)
|
||||
|
||||
this.hlsInstance.on(Hls.Events.MANIFEST_PARSED, () => {
|
||||
console.log('[HLS] Manifest Parsed')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue