Skip to content

Commit 8be28a4

Browse files
Tarteelclaude
andcommitted
fix: start HLS playback from segment 0 instead of live edge
FFmpeg encodes the full prayer at 2-10x real-time speed, so the playlist grows much faster than wall-clock time. Without startPosition:0, hls.js treats the stream as 'live' and seeks to the end of the current playlist, causing users to hear only the last few seconds before the stream ends. Forcing startPosition:0 ensures users always hear the prayer from the beginning. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5f33f74 commit 8be28a4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

frontend/components/AudioPlayer.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ export default function AudioPlayer({ streamUrl, onProgress }: Props) {
4343
const hls = new Hls({
4444
lowLatencyMode: false,
4545
enableWorker: true,
46+
// Always start from segment 0 — the prayer recording begins at the
47+
// start of the playlist, not at the live edge. Without this, hls.js
48+
// would seek to the end of the growing playlist and the user would
49+
// only hear the last few seconds before the stream "ends".
50+
startPosition: 0,
4651
// Buffer aggressively: download well ahead so temporary segment
4752
// generation slowness (FFmpeg) doesn't stall the player.
4853
maxBufferLength: 120, // buffer up to 120s ahead

0 commit comments

Comments
 (0)