-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Live mode 2 #226
Live mode 2 #226
Conversation
2. add toggle interact methods to the player
@Yuyz0112 - here
i.e: |
@rifaideen Yep |
Does this buffer also handle the fact that mouse movement events have a negative offset? |
@eoghanmurray Yes, the buffer will let the timer know things should happen later that the real physical timing. |
Does this work with rrwebPlayer? |
@Yuyz0112 Is it possible to ingest events that have already happened and then start live mode? i.e., Let's say I have been recording events for the last 15 minutes.. and I'm currently also recording events live. I want the player to ingest everything that happened in the last 15 minutes (so it builds out the DOM and more) and immediately join in on the live events and play them in real time? |
@Yuyz0112 Excuse me, but should this work? const events = [item_1, item_2, ..., item_n];
this.replayer = new Replayer(events, {
liveMode: true
});
this.replayer.startLive(item_n.timestamp);
listener.on('event', (event) => {
this.replayer.addEvent(event);
}) |
In this patch, we improved the live mode which made it easier to use and suitable for more real-world scenarios.
Previously, we use a
liveMode
flag to enable live mode in the player. And users can use theaddEvent
method to add events to the player dynamically and asynchronous.But there are some shortages in this implementation:
Since we already add a state machine to our player, it becomes easier to implement a more solid live mode.
Now the public API of the player looks like this: