fix: unstable audio playback
We had convoluted code with audio visualizer, and overall instability in playing back audio.
This commit is contained in:
@@ -40,7 +40,8 @@ export function ParticleRenderer({
|
||||
const renderContent = () => {
|
||||
switch (particle.type) {
|
||||
case "media":
|
||||
return <MediaParticleView particle={particle} onEnded={onNext} />;
|
||||
{/* NOTE: it's more robust to re-mount the MediaParticleView when the particle changes, to ensure playback state is well-behaved */}
|
||||
return <MediaParticleView key={particle.id} particle={particle} onEnded={onNext} />;
|
||||
case "text":
|
||||
return <TextParticleView particle={particle} />;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user