Chapter 691: Pause, resume and abort parsing
Core Idea
:::warning We are phasing out Media Parser and are moving to Mediabunny!
Key Concepts
- Pause and resume
- Cancel a parsing process
- Checking if a parse was aborted
- See also
Code Examples
const controller = mediaParserController();
parseMedia({
src: 'https://www.w3schools.com/html/mov_bbb.mp4',
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 parsing from the official docs.
Key Takeaways
- Understand pause and resume when working with Pause, resume and abort parsing.
- Understand cancel a parsing process when working with Pause, resume and abort parsing.
- Understand checking if a parse was aborted when working with Pause, resume and abort parsing.
- Understand see also when working with Pause, resume and abort parsing.
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.