mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-30 18:12:25 -04:00 
			
		
		
		
	Fix next/previous chapter behavior on public share player
This commit is contained in:
		
							parent
							
								
									80e0cac474
								
							
						
					
					
						commit
						f2ac24e623
					
				| @ -10,7 +10,7 @@ | |||||||
|         <p v-if="mediaItemShare.playbackSession.displayAuthor" class="text-lg lg:text-xl text-slate-400 font-semibold text-center mb-1 truncate">{{ mediaItemShare.playbackSession.displayAuthor }}</p> |         <p v-if="mediaItemShare.playbackSession.displayAuthor" class="text-lg lg:text-xl text-slate-400 font-semibold text-center mb-1 truncate">{{ mediaItemShare.playbackSession.displayAuthor }}</p> | ||||||
| 
 | 
 | ||||||
|         <div class="w-full pt-16"> |         <div class="w-full pt-16"> | ||||||
|           <player-ui ref="audioPlayer" :chapters="chapters" :paused="isPaused" :loading="!hasLoaded" :is-podcast="false" hide-bookmarks hide-sleep-timer @playPause="playPause" @jumpForward="jumpForward" @jumpBackward="jumpBackward" @setVolume="setVolume" @setPlaybackRate="setPlaybackRate" @seek="seek" /> |           <player-ui ref="audioPlayer" :chapters="chapters" :current-chapter="currentChapter" :paused="isPaused" :loading="!hasLoaded" :is-podcast="false" hide-bookmarks hide-sleep-timer @playPause="playPause" @jumpForward="jumpForward" @jumpBackward="jumpBackward" @setVolume="setVolume" @setPlaybackRate="setPlaybackRate" @seek="seek" /> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
|     </div> |     </div> | ||||||
| @ -51,7 +51,8 @@ export default { | |||||||
|       windowHeight: 0, |       windowHeight: 0, | ||||||
|       listeningTimeSinceSync: 0, |       listeningTimeSinceSync: 0, | ||||||
|       coverRgb: null, |       coverRgb: null, | ||||||
|       coverBgIsLight: false |       coverBgIsLight: false, | ||||||
|  |       currentTime: 0 | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   computed: { |   computed: { | ||||||
| @ -83,6 +84,9 @@ export default { | |||||||
|     chapters() { |     chapters() { | ||||||
|       return this.playbackSession.chapters || [] |       return this.playbackSession.chapters || [] | ||||||
|     }, |     }, | ||||||
|  |     currentChapter() { | ||||||
|  |       return this.chapters.find((chapter) => chapter.start <= this.currentTime && this.currentTime < chapter.end) | ||||||
|  |     }, | ||||||
|     coverAspectRatio() { |     coverAspectRatio() { | ||||||
|       const coverAspectRatio = this.playbackSession.coverAspectRatio |       const coverAspectRatio = this.playbackSession.coverAspectRatio | ||||||
|       return coverAspectRatio === this.$constants.BookCoverAspectRatio.STANDARD ? 1.6 : 1 |       return coverAspectRatio === this.$constants.BookCoverAspectRatio.STANDARD ? 1.6 : 1 | ||||||
| @ -154,6 +158,7 @@ export default { | |||||||
| 
 | 
 | ||||||
|       // Update UI |       // Update UI | ||||||
|       this.$refs.audioPlayer.setCurrentTime(time) |       this.$refs.audioPlayer.setCurrentTime(time) | ||||||
|  |       this.currentTime = time | ||||||
|     }, |     }, | ||||||
|     setDuration() { |     setDuration() { | ||||||
|       if (!this.localAudioPlayer) return |       if (!this.localAudioPlayer) return | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user