mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Fix:Stream container not opening on mount
This commit is contained in:
		
							parent
							
								
									d0d19ed1ad
								
							
						
					
					
						commit
						4778d09501
					
				| @ -145,7 +145,7 @@ export default { | |||||||
|     audioPlayerMounted() { |     audioPlayerMounted() { | ||||||
|       this.audioPlayerReady = true |       this.audioPlayerReady = true | ||||||
|       if (this.stream) { |       if (this.stream) { | ||||||
|         console.log('[STREAM-CONTAINER] audioPlayerMounted w/ Stream', this.stream) |         console.log('[STREAM-CONTAINER] audioPlayer Mounted w/ Stream', this.stream) | ||||||
|         this.openStream() |         this.openStream() | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  | |||||||
| @ -74,7 +74,6 @@ export default { | |||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
|     setEntity(_series) { |     setEntity(_series) { | ||||||
|       console.log('setting entity', _series) |  | ||||||
|       this.series = _series |       this.series = _series | ||||||
|     }, |     }, | ||||||
|     setSelectionMode(val) { |     setSelectionMode(val) { | ||||||
|  | |||||||
| @ -85,12 +85,24 @@ export default { | |||||||
|     reconnectFailed() { |     reconnectFailed() { | ||||||
|       console.error('[SOCKET] reconnect failed') |       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) |       console.log('Init Payload', payload) | ||||||
|       if (payload.stream) { |       if (payload.stream) { | ||||||
|         if (this.$refs.streamContainer) { |         if (this.$refs.streamContainer) { | ||||||
|           this.$store.commit('setStream', payload.stream) |           this.$store.commit('setStream', payload.stream) | ||||||
|           this.$refs.streamContainer.streamOpen(payload.stream) |           this.$refs.streamContainer.streamOpen(payload.stream) | ||||||
|  |         } else { | ||||||
|  |           console.warn('Stream Container not mounted') | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|       if (payload.user) { |       if (payload.user) { | ||||||
|  | |||||||
| @ -118,7 +118,7 @@ module.exports = { | |||||||
|         userAudiobook: user.getAudiobookJSON(book.id), |         userAudiobook: user.getAudiobookJSON(book.id), | ||||||
|         book |         book | ||||||
|       } |       } | ||||||
|     }) |     }).filter(b => !!b.userAudiobook) | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
|   getBooksMostRecentlyRead(booksWithUserAb, limit, minified = false) { |   getBooksMostRecentlyRead(booksWithUserAb, limit, minified = false) { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user