bugfix and update rrweb

This commit is contained in:
Yanzhen Yu
2018-12-27 18:18:29 +08:00
parent c00b38ba1a
commit 4f6ef05f13
3 changed files with 8 additions and 5 deletions

View File

@@ -136,11 +136,14 @@
}
},
setSpeed(speed) {
const { replayer, currentTime } = this.get();
const { replayer, currentTime, isPlaying } = this.get();
// freeze before set speed, and resume if is playing before freeze
replayer.pause();
replayer.setConfig({ speed });
this.set({ speed });
replayer.resume(currentTime);
if (isPlaying) {
replayer.resume(currentTime);
}
},
handleProgressClick(event) {
const progressRect = this.refs.progress.getBoundingClientRect();
@@ -162,6 +165,7 @@
},
onupdate({ changed, current, previous }) {
if (current.replayer && !previous) {
window.replayer = current.replayer;
// auto play
setTimeout(() => {
this.set({ isPlaying: true });
@@ -192,7 +196,7 @@
}
}
if (changed.skipInactive) {
current.replayer.setConfig({ skipInactive: changed.skipInactive });
current.replayer.setConfig({ skipInactive: current.skipInactive });
}
},
ondestroy() {

View File

@@ -21,7 +21,6 @@
.label {
margin: 0 8px;
height: 1em;
}
.switch input[type='checkbox'] {