Commit Graph

9 Commits

Author SHA1 Message Date
Yanzhen Yu
533885a707 export timer to public API 2018-12-26 20:58:14 +08:00
Yanzhen Yu
aaa8bb9e94 add skipInactive option
Skip inactive time is an important and useful feature. We consider
user interaction events as active, and check next user interaction
event after apply incremental snapshot.
If next user interaction event has a time gap larger than the
threshold, we will set a dynamic speed value which will skip the
inactive time interval in about 5 seconds.
2018-12-26 18:05:55 +08:00
Yanzhen Yu
b9e4117810 fix timer requestAnimationFrame call may not stop after clear
Before this patch, the checker in the timer will stop only when
actions array is empty.
When we call play more than once, it will clear the timer first,
then  push filtered new actions and start the timer again. If
all of this happened in a frame, the checker which should be
cleared may found actions array is not empty and keep check.
So this patch we use timer.raf to hold raf's handle and cancel
it when clear was called.
2018-12-14 13:37:00 +08:00
Yanzhen Yu
181c8e1d5d fix timer clear method with do not reassign actions pointer 2018-11-23 14:22:18 +08:00
edwardwu
6382315d43 resolve #4 Improve timer's performance by storing all callbacks in an array (#5) 2018-11-16 21:53:59 +08:00
Yanzhen Yu
6c8cf5c379 implemented the play any offset feature 2018-10-18 16:24:01 +08:00
Yanzhen Yu
d827fdc947 impl dynamic config and pause. Bump 0.3.0 2018-10-16 15:31:56 +08:00
Yanzhen Yu
95713f1ea7 apply viewport resize and input event changes 2018-10-12 16:04:07 +08:00
Yanzhen Yu
f4bf94aa2d use raf to impl a more accurate timer and replay events async 2018-10-12 14:30:44 +08:00