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.js"></script>
|
||||||
<script src="./bundle.events.js"></script>
|
<script src="./bundle.events.js"></script>
|
||||||
<script>
|
<script>
|
||||||
const player = new rrwebPlayer({
|
const queryObj = {
|
||||||
target: document.body,
|
sessionId: 'e2c7cfe8-d868-4f11-b561-5a969da26334',
|
||||||
data: {
|
};
|
||||||
events,
|
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>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,11 @@
|
|||||||
},
|
},
|
||||||
play() {
|
play() {
|
||||||
const { replayer, currentTime } = this.get();
|
const { replayer, currentTime } = this.get();
|
||||||
replayer.play(currentTime);
|
if (currentTime > 0) {
|
||||||
|
replayer.resume(currentTime);
|
||||||
|
} else {
|
||||||
|
replayer.play(currentTime);
|
||||||
|
}
|
||||||
this.loopTimer();
|
this.loopTimer();
|
||||||
},
|
},
|
||||||
pause() {
|
pause() {
|
||||||
|
|||||||
@@ -29,5 +29,5 @@ export function formatTime(ms) {
|
|||||||
if (hour) {
|
if (hour) {
|
||||||
return `${padZero(hour)}:${padZero(minute)}:${padZero(minute)}`;
|
return `${padZero(hour)}:${padZero(minute)}:${padZero(minute)}`;
|
||||||
}
|
}
|
||||||
return `${padZero(hour)}:${padZero(second)}`;
|
return `${padZero(minute)}:${padZero(second)}`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user