Capítulo 179 de 988

Chapter 179: Muting Audio

Core Idea

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

Key Concepts

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

Code Examples

export const MyComposition = () => {
  const frame = useCurrentFrame();
  const {fps} = useVideoConfig();

  return (
    <AbsoluteFill>
      <Audio src={staticFile('audio.mp3')} muted={frame >= 2 * fps && frame <= 4 * fps} />
    </AbsoluteFill>
  );
};
  • What it demonstrates: Usage pattern for Muting Audio from the official docs.

Key Takeaways

  1. Understand muting audio when working with Muting Audio.

Connects To

  • Animatedimage: related page in the Assets & Media section.
  • Delaying: related page in the Assets & Media section.
  • Exporting: related page in the Assets & Media section.