Play one animation
Give the Masko player one animation's files and it loops it with its transparency, with no flash between loops and with the animation's own voice when it has one. Hosted links do not expire, so this needs no backend and no API key. Install the player for your platform first.
Get the files
Turn on hosting for the mascot, then copy the animation's links from Get Links in Studio or from the Get Links JSON. Put your mascot on your website shows each step.
| Platform | Files |
|---|---|
| Web and React | transparent_video_webm and transparent_video_mov (HEVC) |
| iPhone, iPad and Mac | transparent_video_mov (HEVC) |
| Android | transparent_video_android (the stacked MP4) |
| React Native | transparent_video_mov and transparent_video_android |
Play it
import { mountMascot } from '@masko/player';
mountMascot(document.getElementById('mascot'), {
clip: { webm: 'https://assets.masko.ai/.../wave.webm', hevc: 'https://assets.masko.ai/.../wave.mov' }
});The player reads the file's length and loops it. A clip whose length cannot be read plays nothing and reports the error event with clip_failed. For visitors who turn off animations, pass autoPlay: !matchMedia('(prefers-reduced-motion: reduce)').matches on the web: the player then shows the first frame and waits.
Switch between animations
A new clip starts a new player, so the mascot can blink between two animations. To switch between animations, or to make the mascot react to your app, put them in a canvas and play its release: Play a canvas.
