This library wraps asciinema-player
in a custom element, so it can be used in any framework without needing to run AsciinemaPlayer.create
for each player you want to spawn.
You can use your preferred package manager
npm i asciinema-player-ce
# or
pnpm i asciinema-player-ce
# or
yarn add asciinema-player-ce
import it and use it to define a custom element on your window.
import { useAsciinemaCe } from 'asciinema-player-ce'
useAsciinemaCe()
Add the following script to your document
<script src="https://cdn.jsdelivr.net/npm/asciinema-player-ce@latest/lib/asciinema-player.iife.min.js"></script>
<script defer>
asciinemaPlayerCe.useAsciinemaCe()
</script>
You can simply use asciinema-player tag.
<!-- put your cast id inside src -->
<asciinema-player src=""></asciinema-player>