Fix:Stream url format issues

This commit is contained in:
advplyr 2022-02-22 19:02:01 -06:00
parent 74d5174cfc
commit d2c6f1bab1
4 changed files with 5 additions and 5 deletions

View File

@ -14,6 +14,6 @@ export default class AudioTrack {
if (process.env.NODE_ENV === 'development') {
return `${process.env.serverUrl}${this.contentUrl}`
}
return `${window.location.origin}/${this.contentUrl}`
return `${window.location.origin}${this.contentUrl}`
}
}

View File

@ -78,7 +78,7 @@ export default class CastPlayer extends EventEmitter {
if (process.env.NODE_ENV === 'development') {
this.coverUrl = coverImg
} else {
this.coverUrl = `${window.location.origin}/${coverImg}`
this.coverUrl = `${window.location.origin}${coverImg}`
}
var request = buildCastLoadRequest(this.audiobook, this.coverUrl, this.audioTracks, this.currentTime, playWhenReady, this.defaultPlaybackRate)

View File

@ -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.fullContentUrl
this.player.src = this.currentTrack.contentUrl
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.fullContentUrl)
this.hlsInstance.loadSource(this.currentTrack.contentUrl)
this.hlsInstance.on(Hls.Events.MANIFEST_PARSED, () => {
console.log('[HLS] Manifest Parsed')

View File

@ -5,7 +5,7 @@ export default (ctx) => {
return data.results.filter((b) => b.book.cover).map((ab) => {
var coverUrl = ctx.$store.getters['audiobooks/getBookCoverSrc'](ab)
if (process.env.NODE_ENV === 'development') return coverUrl
return `${window.location.origin}/${coverUrl}`
return `${window.location.origin}${coverUrl}`
})
}).catch((error) => {
console.error('failed to fetch books', error)