Files
study-bible-project/src/components/reader/AudioSheet.jsx
T
nmemmertandClaude Sonnet 5.5 3279dddae5
Build and Push Docker Image / build-and-push (push) Failing after 19s
Reader: ESV chapter audio
The Reader's player follows the translation on screen: ESV plays its own
recording via a server route that resolves the ESV API's audio redirect;
other translations keep the BSB narrators.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-29 09:20:15 -04:00

40 lines
1.7 KiB
React

import Sheet from './Sheet.jsx';
import AudioPlayer from '../AudioPlayer.jsx';
// Wraps the existing player. Audio is BSB-only, so licensed translations get a note.
export default function AudioSheet({ open, onClose, translation, bookName, chapter, audio, narrator, onNarrator, onNext, nextDisabled }) {
return (
<Sheet open={open} onClose={onClose} title="Listen">
<AudioPlayer
title={`${bookName} ${chapter}`}
subtitle={audio.state.status === 'error'
? "Couldn't load audio for this chapter/narrator."
: translation === 'ESV'
? 'ESV audio, read by David Cochran Heath. It follows the chapter as you browse.'
: translation !== 'BSB'
? `Audio is BSB only — no ${translation} audio is available, so it won't match the ${translation} text on screen.`
: 'Audio follows the chapter as you browse.'}
status={audio.state.status}
currentTime={audio.progress.currentTime}
duration={audio.progress.duration}
onPlay={audio.play}
onTogglePause={audio.togglePause}
onSeekBack={() => audio.seek(-10)}
onSeekForward={() => audio.seek(10)}
onSeekTo={audio.seekTo}
onNext={onNext}
nextDisabled={nextDisabled}
onStop={audio.stop}
controls={translation === 'ESV' ? null : (
<select value={narrator} onChange={(e) => onNarrator(e.target.value)}
className="rounded-xl border border-[var(--r-line)] bg-[var(--r-bg)] px-2 py-1.5 text-sm text-[var(--r-text)]">
<option value="david">David</option>
<option value="hays">Hays</option>
<option value="souer">Souer</option>
</select>
)}
/>
</Sheet>
);
}