Skip to content

Commit 09db735

Browse files
committed
Update trimPlayer.js
1 parent 4e0c63b commit 09db735

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

monitor/js/app/trimPlayer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class TrimPlayer {
2222

2323
// Absolute UTC state (no offsets)
2424
this.#state = {};
25-
this.#state.gap = opts.gap ?? 10_000;
25+
this.#state.gap = opts.gap ?? 60_000;
2626
this.#state.speedUp = 20;
2727
this.#state.start = opts.start ?? Date.now();
2828
this.#state.end = Math.max(opts.end ?? 0, this.#state.start + this.#state.gap);
@@ -55,8 +55,8 @@ export class TrimPlayer {
5555
}
5656

5757
setTrim(range) {
58-
const s = Math.max(this.#state.start, range[0]);
59-
const e = Math.min(this.#state.end, range[1]);
58+
const s = this.#clampUtc(range[0], this.#state.start, this.#state.end);
59+
const e = this.#clampUtc(range[1], this.#state.start, this.#state.end);
6060
this.#state.trimStart = Math.min(s, e - this.#state.gap);
6161
this.#state.trimEnd = Math.max(e, s + this.#state.gap);
6262
this.#state.current = this.#clampUtc(this.#state.current, this.#state.trimStart, this.#state.trimEnd);
@@ -292,7 +292,7 @@ export class TrimPlayer {
292292

293293
#utcLabel(utcMs) {
294294
const d = new Date(utcMs);
295-
return d.toISOString().replace('T', ' ').slice(0, 19);
295+
return d.toISOString().replace('T', ' ').slice(0, 23);
296296
}
297297

298298
#positionFloatingLabel(anchorEl = null) {

0 commit comments

Comments
 (0)