Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add dynamic data #277

Open
MarkoH17 opened this issue Feb 22, 2025 · 0 comments
Open

Feature Request: Add dynamic data #277

MarkoH17 opened this issue Feb 22, 2025 · 0 comments

Comments

@MarkoH17
Copy link

First off, thank you for such a great project!

I have a use case where I would like to push new events to an already-mounted asciinema-player instance. I understand that I can use the websocket driver to stream events, but I think it would be useful to expose an API where data events could be pushed, something like:

let domElement = document.getElementById("#someId");
let playerInstance = AsciinemaPlayer.create({ data: [...] }, domElement);

this.domElement.on('my-custom-data-event', (event) => {
  let newEvents = event.myCustomEvents; // myCustomEvents = [[timestamp_delta, mode, content]]

  this.playerInstance.appendEvents(newEvents);
})

The docs indicate that data can be "dynamically loaded", yet it appears that this only occurs when playing begins.

If exposing an API to append data to an existing stream isn't possible, would you consider allowing custom drivers to be specified during initialization so custom data loading behavior can be used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant