Skip to main content

Muting Audio

You may pass in the muted prop to <Audio>, <Video>, <OffthreadVideo>, <Html5Audio> and <Html5Video> and even change it over time.

When muted is true, audio will be omitted at that time. In the following example, we are muting the track between seconds 2 and 4.

tsx
import {AbsoluteFill, staticFile, useCurrentFrame, useVideoConfig} from'remotion';
import {Html5Audio} from'remotion';
exportconstMyComposition= () => {
constframe=useCurrentFrame();
const {fps} =useVideoConfig();
return (
<AbsoluteFill>
<Html5Audiosrc={staticFile('audio.mp3')} muted={frame >=2* fps && frame <=4* fps} />
</AbsoluteFill>
);
};

AltStyle によって変換されたページ (->オリジナル) /