Skip to content

3.3.0

Compare
Choose a tag to compare
@ku1ik ku1ik released this 14 May 20:07
· 418 commits to develop since this release
  • improved initialization with regards to obtaining font metrics (helps when embedding in Reveal.js slides)
  • exposed input recorded with asciinema rec --stdin via input events
  • added inputOffset source option to shift fired input events in time
  • fixed player.play() to not act like toggle
  • disabled font ligatures
  • added minFrameTime source option to change FPS cap (default: 1/60s)
  • smoother playback without jitter for websocket and eventsource drivers thanks to (now) default buffer of 100ms
  • improved handling of current time for live drivers
  • changed loading indicator to more familiar, good looking one
  • refactored player core with regards to states player can be in

Example use of new input event:

const player = AsciinemaPlayer.create('/demo.cast', document.getElementById('demo'));

player.addEventListener('input', { data } => {
  console.log('input!', JSON.stringify(data));
})

inputOffset source option can be used to shift fired input events in time, e.g. when you need them to fire earlier due to audio samples taking extra time to be emitted:

const player = AsciinemaPlayer.create({
  url: '/demo.cast',
  inputOffset: -0.25
}, document.getElementById('demo'));

player.addEventListener('input', { data } => {
  // this is fired 250 ms earlier than it would be without `inputOffset`
  playSound(data);
})