Capítulo 727 de 988

Chapter 727: Pause, resume and abort conversion

Core Idea

:::warning We are phasing out Remotion WebCodecs and are moving to Mediabunny!

Key Concepts

  • Pause and resume
  • Cancel a conversion
  • Checking if a conversion was aborted
  • See also

Code Examples

const controller = webcodecsController();

convertMedia({
  src: 'https://www.w3schools.com/html/mov_bbb.mp4',
  container: 'webm',
  controller,
})
  .then(() => {
    console.log('Finished downloading');
  })
  .catch((err) => {
    console.error('Error downloading', err);
  });

// Wait 1 sec, pause, wait 1 sec, resume
await new Promise((resolve) => setTimeout(resolve, 1000));
controller.pause();
await new Promise((resolve) => setTimeout(resolve, 1000));
controller.resume();
  • What it demonstrates: Usage pattern for Pause, resume and abort conversion from the official docs.

Key Takeaways

  1. Understand pause and resume when working with Pause, resume and abort conversion.
  2. Understand cancel a conversion when working with Pause, resume and abort conversion.
  3. Understand checking if a conversion was aborted when working with Pause, resume and abort conversion.
  4. Understand see also when working with Pause, resume and abort conversion.

Connects To

  • Buffer Writer: related page in the WebCodecs (@remotion/webcodecs) section.
  • can Copy Audio Track: related page in the WebCodecs (@remotion/webcodecs) section.
  • can Copy Video Track: related page in the WebCodecs (@remotion/webcodecs) section.