update rrweb and use the resume method with better performance
This commit is contained in:
@@ -15,12 +15,24 @@
|
||||
<script src="./bundle.js"></script>
|
||||
<script src="./bundle.events.js"></script>
|
||||
<script>
|
||||
const player = new rrwebPlayer({
|
||||
target: document.body,
|
||||
data: {
|
||||
events,
|
||||
},
|
||||
const queryObj = {
|
||||
sessionId: 'e2c7cfe8-d868-4f11-b561-5a969da26334',
|
||||
};
|
||||
let query = '';
|
||||
Object.keys(queryObj).forEach(key => {
|
||||
query += `${key}=${queryObj[key]}&`;
|
||||
});
|
||||
fetch(`http://192.168.17.205:9090/api/events?${query}`)
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
// eslint-disable-next-line
|
||||
new rrwebPlayer({
|
||||
target: document.body,
|
||||
data: {
|
||||
events: data.events,
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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)}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user