New model update audio player, stream, collections

This commit is contained in:
advplyr 2022-03-12 19:59:35 -06:00
parent 2d19208340
commit 65df377a49
20 changed files with 145 additions and 145 deletions

View file

@ -8,7 +8,7 @@ export default class LocalPlayer extends EventEmitter {
this.ctx = ctx
this.player = null
this.audiobook = null
this.libraryItem = null
this.audioTracks = []
this.currentTrackIndex = 0
this.hlsStreamId = null
@ -110,8 +110,8 @@ export default class LocalPlayer extends EventEmitter {
}
}
set(audiobook, tracks, hlsStreamId, startTime, playWhenReady = false) {
this.audiobook = audiobook
set(libraryItem, tracks, hlsStreamId, startTime, playWhenReady = false) {
this.libraryItem = libraryItem
this.audioTracks = tracks
this.hlsStreamId = hlsStreamId
this.playWhenReady = playWhenReady
@ -198,7 +198,7 @@ export default class LocalPlayer extends EventEmitter {
async resetStream(startTime) {
this.destroyHlsInstance()
await new Promise((resolve) => setTimeout(resolve, 1000))
this.set(this.audiobook, this.audioTracks, this.hlsStreamId, startTime, true)
this.set(this.libraryItem, this.audioTracks, this.hlsStreamId, startTime, true)
}
playPause() {