mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-16 00:39:40 +00:00
Add:Chromecast support in experimental #367, Change:Audio player model for direct play
This commit is contained in:
parent
9f133ba98c
commit
89f498f31a
26 changed files with 1113 additions and 672 deletions
19
client/players/AudioTrack.js
Normal file
19
client/players/AudioTrack.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
export default class AudioTrack {
|
||||
constructor(track) {
|
||||
this.index = track.index || 0
|
||||
this.startOffset = track.startOffset || 0 // Total time of all previous tracks
|
||||
this.duration = track.duration || 0
|
||||
this.title = track.filename || ''
|
||||
this.contentUrl = track.contentUrl || null
|
||||
this.mimeType = track.mimeType
|
||||
}
|
||||
|
||||
get fullContentUrl() {
|
||||
if (!this.contentUrl || this.contentUrl.startsWith('http')) return this.contentUrl
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
return `${process.env.serverUrl}${this.contentUrl}`
|
||||
}
|
||||
return `${window.location.origin}/${this.contentUrl}`
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue