You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

asciicast.js 563B

1234567891011121314
  1. export async function renderAsciinemaPlayer() {
  2. const els = document.querySelectorAll('.asciinema-player-container');
  3. if (!els.length) return;
  4. const player = await import(/* webpackChunkName: "asciinema-player" */'asciinema-player');
  5. for (const el of els) {
  6. player.create(el.getAttribute('data-asciinema-player-src'), el, {
  7. // poster (a preview frame) to display until the playback is started.
  8. // Set it to 1 hour (also means the end if the video is shorter) to make the preview frame show more.
  9. poster: 'npt:1:0:0',
  10. });
  11. }
  12. }