Capítulo 695 de 988

Chapter 695: Seeking

Core Idea

:::warning We are phasing out Media Parser and are moving to Mediabunny!

Key Concepts

  • When you cannot seek
  • Simulate a seek<AvailableFrom v="4.0.312" />
  • How smart is seeking?

Code Examples

const controller = mediaParserController();

// You can make a seek even before starting a parse
// This will be considered before emitting the first sample
controller.seek(5); // Seek to 5 seconds

await parseMedia({
  src: 'https://remotion.media/video.mp4',
  controller,
  onVideoTrack: () => {
    return () => {
      // You can also seek inmidst a parse.
      controller.seek(10); // Seek to 10 seconds
    };
  },
});
  • What it demonstrates: Usage pattern for Seeking from the official docs.

Key Takeaways

  1. Understand when you cannot seek when working with Seeking.
  2. Understand simulate a seek<availablefrom v="4.0.312" /> when working with Seeking.
  3. Understand how smart is seeking? when working with Seeking.

Connects To

  • Download and Parse: related page in the Media Parser (@remotion/media-parser) section.
  • Download and Parse Media: related page in the Media Parser (@remotion/media-parser) section.
  • Fast and Slow: related page in the Media Parser (@remotion/media-parser) section.