2026-06-07 03:58:32 -04:00
|
|
|
"use client";
|
|
|
|
|
|
2026-06-07 17:54:30 -04:00
|
|
|
import { WaveformPlayer } from "./waveform-player";
|
2026-06-07 03:58:32 -04:00
|
|
|
|
2026-06-07 17:54:30 -04:00
|
|
|
/**
|
|
|
|
|
* Episode audio player — a thin wrapper around the custom WaveformPlayer so the
|
|
|
|
|
* authed asset route and (optional) ZIP export are wired up for the editor.
|
|
|
|
|
*/
|
2026-06-07 03:58:32 -04:00
|
|
|
export function AudioPlayer({
|
|
|
|
|
storageKey,
|
|
|
|
|
durationSec,
|
2026-06-07 17:54:30 -04:00
|
|
|
episodeId,
|
2026-06-07 03:58:32 -04:00
|
|
|
}: {
|
|
|
|
|
storageKey: string;
|
|
|
|
|
durationSec?: number | null;
|
2026-06-07 17:54:30 -04:00
|
|
|
episodeId?: string;
|
2026-06-07 03:58:32 -04:00
|
|
|
}) {
|
|
|
|
|
const src = `/api/assets/${storageKey}`;
|
|
|
|
|
return (
|
2026-06-07 17:54:30 -04:00
|
|
|
<WaveformPlayer
|
|
|
|
|
src={src}
|
|
|
|
|
downloadUrl={`${src}?download=1`}
|
|
|
|
|
durationSec={durationSec}
|
|
|
|
|
exportUrl={episodeId ? `/api/episodes/${episodeId}/export` : undefined}
|
|
|
|
|
/>
|
2026-06-07 03:58:32 -04:00
|
|
|
);
|
|
|
|
|
}
|