Capítulo 81 de 988

Chapter 81: useVideoConfig()

Core Idea

With this hook, you can retrieve some info about the composition you are in.

Key Concepts

  • Example
  • Return value
  • width
  • height
  • fps
  • durationInFrames
  • id
  • defaultProps

Code Examples

export const MyComp: React.FC = () => {
  const {width, height, fps, durationInFrames} = useVideoConfig();
  console.log(width); // 1920
  console.log(height); // 1080
  console.log(fps); // 30;
  console.log(durationInFrames); // 300

  return <div>Hello World!</div>;
};
  • What it demonstrates: Usage pattern for useVideoConfig() from the official docs.

Key Takeaways

  1. Understand example when working with useVideoConfig().
  2. Understand return value when working with useVideoConfig().
  3. Understand width when working with useVideoConfig().
  4. Understand height when working with useVideoConfig().
  5. Understand fps when working with useVideoConfig().

Connects To

  • Cancel Render: related page in the Hooks & Data APIs section.
  • Continue Render: related page in the Hooks & Data APIs section.
  • Data Fetching: related page in the Hooks & Data APIs section.