Fix:Stream container not opening on mount

This commit is contained in:
advplyr 2022-01-05 18:01:33 -06:00
parent d0d19ed1ad
commit 4778d09501
4 changed files with 15 additions and 4 deletions

View File

@ -145,7 +145,7 @@ export default {
audioPlayerMounted() {
this.audioPlayerReady = true
if (this.stream) {
console.log('[STREAM-CONTAINER] audioPlayerMounted w/ Stream', this.stream)
console.log('[STREAM-CONTAINER] audioPlayer Mounted w/ Stream', this.stream)
this.openStream()
}
},

View File

@ -74,7 +74,6 @@ export default {
},
methods: {
setEntity(_series) {
console.log('setting entity', _series)
this.series = _series
},
setSelectionMode(val) {

View File

@ -85,12 +85,24 @@ export default {
reconnectFailed() {
console.error('[SOCKET] reconnect failed')
},
init(payload) {
init(payload, count = 0) {
if (!this.$refs.streamContainer) {
if (count > 20) {
console.error('Stream container never mounted')
return
}
setTimeout(() => {
this.init(payload, ++count)
}, 100)
return
}
console.log('Init Payload', payload)
if (payload.stream) {
if (this.$refs.streamContainer) {
this.$store.commit('setStream', payload.stream)
this.$refs.streamContainer.streamOpen(payload.stream)
} else {
console.warn('Stream Container not mounted')
}
}
if (payload.user) {

View File

@ -118,7 +118,7 @@ module.exports = {
userAudiobook: user.getAudiobookJSON(book.id),
book
}
})
}).filter(b => !!b.userAudiobook)
},
getBooksMostRecentlyRead(booksWithUserAb, limit, minified = false) {