You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the same issue. I am using React.js server-side rendering for mine. I see the audio file retrieved, and I can play the audio just fine, but the waveform and the progress are not rendering as the color defined for them.
I have the same issue. I am using React.js server-side rendering for mine. I see the audio file retrieved, and I can play the audio just fine, but the waveform and the progress are not rendering as the color defined for them.
Originally posted by @LouMM in #3957 (comment)
typescript
useEffect(() => {// Only create WaveSurfer on the client side (avoid SSR issues)
if (typeof window !== "undefined" && waveformRef.current) {
waveSurfer.current = WaveSurfer.create({
container: waveformRef.current,
height: 100,
waveColor: "rgb(200, 0, 200)",
progressColor: "rgb(13, 226, 63)",
url: audioUrl,
fetchParams: { mode: "no-cors" },
});
waveSurfer.current.on("ready", () => {
console.log("WaveSurfer is ready");
});
}
// Cleanup on unmount
return () => {
if (waveSurfer.current) {
waveSurfer.current.destroy();
}
};
}, [audioUrl]);
const handlePlayPause = () => {
if (!waveSurfer.current) return;
};
return (
{/* Optional Title */}
{title && (
<Typography variant={isMobile ? "h6" : "h5"} sx={{ mb: 1 }}>
{title}
)}
);
};`
The text was updated successfully, but these errors were encountered: