yarn list player-animator # or pnpm list player-animator The output should display player-animator@0.9.9 or higher. Sometimes you just want to test a prototype or work in a legacy environment. You can install player-animator, version 0.9.9 or later via a CDN. Add this script tag to your HTML <head> or just before the closing </body> :
// ES module syntax (recommended) import PlayerAnimator from 'player-animator'; // CommonJS (if you're still using require) const PlayerAnimator = require('player-animator'); If you prefer Yarn's speed or PNPM's disk efficiency, use these commands: install player-animator%2C version 0.9.9 or later.
const PlayerAnimator = window.PlayerAnimator; const myAnimation = new PlayerAnimator( duration: 5000, frames: [0, 0.25, 0.5, 0.75, 1] ); ⚠️ Avoid using @latest in production, as a hypothetical 1.0.0 could introduce breaking changes. Always pin to 0.9.x or a specific version. Method 4: Installing in React and Next.js Projects React developers should take care to use useEffect to avoid server-side rendering (SSR) mismatches, as Player-Animator relies on the browser window object. yarn list player-animator # or pnpm list player-animator
This pattern guarantees you are using version 0.9.9 or later because npm installed it explicitly. For Vue 3 with Composition API: Add this script tag to your HTML <head>
);
const pa = new PlayerAnimator( duration: 1000, frames: [0,1] ); if (typeof pa.seekTo === 'function') console.log('✅ Version 0.9.9 or later confirmed (seekTo API exists)'); else console.error('❌ You have an older version. Reinstall with @0.9.9');