Commit Graph

13 Commits

Author SHA1 Message Date
Yanzhen Yu
9a3e1fe724 fix last played timestamp when it is a mousemove event 2020-09-20 12:37:20 +08:00
Yanzhen Yu
9b8c7f755f close #161 support "addEvent" in any state 2020-09-07 09:44:03 +08:00
Yanzhen Yu
cdebe18803 close #320 use emitter handler to catch before load state 2020-09-06 18:14:11 +08:00
Justin Halsall
6934fab78d Update lastPlayedEvent in live mode (#327)
* Update lastPlayedEvent in live mode

* tricking travis-ci into running again
2020-09-05 17:26:48 +08:00
Justin Halsall
e717cda658 Fix live mode (#310)
* add failing test

* paused -> live now possible
2020-08-27 21:33:12 +08:00
Yanzhen Yu
a90999d96e close #274 implement the new state management proposal 2020-08-08 17:07:37 +08:00
Eoghan Murray
286b520907 Restore functioning of #200 - this got broken after #242 (#246)
- What was broken was that it would just play activity from the first page view, but then would stop at the second page view (meta) as actions after that had been discarded
 - This restores the functionality given by the comment 'return the events from last meta to the end.' - we never want to discard events that are after the baseline time
 - I believe 'session' is the incorrect terminology for this function name, as a session in web analytics usually means a series of page views
2020-07-16 00:12:37 +08:00
yz-yu
e2cc42e393 fix the skip event calculation (#242) 2020-07-11 17:06:56 +08:00
Yanzhen Yu
3e2b596664 tweak the code of getting last session, without splice events array 2020-07-11 11:03:40 +08:00
Yanzhen Yu
4bf533a675 fast-forward implementation v1
related to #6

Since the currently 'play at any time offset' implementation is pretty simple,
there are many things we can do to optimize its performance.

In this patch, we do the following optimizations:
1. Ignore some of the events during fast forward.
   For example, when we are going to fast forward to 10 minutes later,
   we do not need to perform mouse movement events during this period.
2. Use a fragment element as the 'virtual parent node'.
   So newly added DOM nodes will be appended to this fragment node,
   and finally being appended into the document as a batch operation.
These changes reduce a lot of time which was spent on reflow/repaint previously.
I've seen a 10 times performance improvement within these approaches.

And there are still some things we can do better but not in this patch.
1. We can build a virtual DOM tree to store the mutations of DOM.
   This will minimize the number of DOM operations.
2. Another thing that may help UX is to make the fast forward process async and cancellable.
   This may make the drag and drop interactions in the player's UI looks smooth.
2020-07-11 11:03:40 +08:00
Eoghan Murray
ef2c991012 Only execute events since most recent pageload when playing from an offset (#200)
On recordings with many full pageloads, dom state and mutations were being applied only to be discarded when a new pageload came in, resulting in very slow time to rebuild - and inability to interactively 'scrub' through these recordings
2020-07-11 10:21:46 +08:00
yz-yu
8913bcb9d6 Live mode 2 (#226)
* refactoring play, pause, resume, load style sheet to subscribe style code

* support live mode in state machine

* 1. upgrade @xstate/fsm
2. add toggle interact methods to the player
2020-05-31 15:40:17 +08:00
yz-yu
877e2ce958 impl basic player state machine (#198) 2020-04-12 15:16:30 +08:00