feat: listening settings tab controls, warm-up button, resume button
- Listening tab: expose Speed, Auto-next, and Announce chapter controls alongside the existing Player Style row (chapters/[n]/+page.svelte) - AudioPlayer: add Warm up Ch. N button in standard player ready state when autoNext is off; shows prefetching spinner and completion status - Book page: fetch saved audioTime on mount; show Resume Ch. N button (desktop + mobile) that sets autoStartChapter and navigates directly
This commit is contained in:
@@ -1345,6 +1345,47 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Warm-up next chapter (only when autoNext is off and next exists) -->
|
||||
{#if !audioStore.autoNext && nextChapter != null}
|
||||
<div class="mt-2 flex items-center gap-2">
|
||||
{#if audioStore.nextStatus === 'none'}
|
||||
<button
|
||||
type="button"
|
||||
onclick={prefetchNext}
|
||||
class="flex items-center gap-1.5 text-xs text-(--color-muted) hover:text-(--color-brand) transition-colors"
|
||||
title="Pre-generate audio for the next chapter"
|
||||
>
|
||||
<svg class="w-3.5 h-3.5" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M7 2l10 10L7 22z"/>
|
||||
</svg>
|
||||
Warm up Ch. {nextChapter}
|
||||
</button>
|
||||
{:else if audioStore.nextStatus === 'prefetching'}
|
||||
<span class="flex items-center gap-1.5 text-xs text-(--color-muted)">
|
||||
<svg class="w-3.5 h-3.5 animate-spin" fill="none" viewBox="0 0 24 24">
|
||||
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
||||
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path>
|
||||
</svg>
|
||||
Warming up Ch. {nextChapter}…
|
||||
</span>
|
||||
{:else if audioStore.nextStatus === 'prefetched'}
|
||||
<span class="flex items-center gap-1.5 text-xs text-(--color-brand)">
|
||||
<svg class="w-3.5 h-3.5" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
|
||||
</svg>
|
||||
Ch. {nextChapter} ready
|
||||
</span>
|
||||
{:else if audioStore.nextStatus === 'failed'}
|
||||
<span class="flex items-center gap-1.5 text-xs text-red-400">
|
||||
<svg class="w-3.5 h-3.5" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
|
||||
</svg>
|
||||
Warm-up failed
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{:else if audioStore.active}
|
||||
|
||||
Reference in New Issue
Block a user