From 8f1d9d5ca9d74e0e94151590aacd724427dd4007 Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Fri, 2 Nov 2018 11:07:56 +0800 Subject: [PATCH] update rrweb and use the resume method with better performance --- public/index.html | 22 +++++++++++++++++----- src/Controller.html | 6 +++++- src/utils.js | 2 +- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/public/index.html b/public/index.html index cf5165fb..0596bb61 100644 --- a/public/index.html +++ b/public/index.html @@ -15,12 +15,24 @@ diff --git a/src/Controller.html b/src/Controller.html index 2ec2bd37..1c55cf26 100644 --- a/src/Controller.html +++ b/src/Controller.html @@ -72,7 +72,11 @@ }, play() { const { replayer, currentTime } = this.get(); - replayer.play(currentTime); + if (currentTime > 0) { + replayer.resume(currentTime); + } else { + replayer.play(currentTime); + } this.loopTimer(); }, pause() { diff --git a/src/utils.js b/src/utils.js index b19c4603..22adf05c 100644 --- a/src/utils.js +++ b/src/utils.js @@ -29,5 +29,5 @@ export function formatTime(ms) { if (hour) { return `${padZero(hour)}:${padZero(minute)}:${padZero(minute)}`; } - return `${padZero(hour)}:${padZero(second)}`; + return `${padZero(minute)}:${padZero(second)}`; }