Skip to main content
Version: 0.11

Create a Movie

What is a Movie?

In Etro, a movie renders one or more layers of content to a <canvas> element and audio context or a blob.

Import Etro

To get started, import Etro into your project:

import etro from "etro";

Create a Canvas

Next, create an HTML <canvas> element to render your movie to and display it on the page:

const canvas = document.createElement("canvas");
document.body.appendChild(canvas);

Create the Movie

Now, you can create a new etro.Movie instance:

const movie = new etro.Movie({
canvas,
});