Skip to content

Commit 3db9c6a

Browse files
rename to durationMS
1 parent 0e6c97e commit 3db9c6a

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

static/app/components/replays/replayContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ function ProviderNonMemo({
495495
setVideoBuffering(buffering);
496496
},
497497
clipWindow,
498-
duration: durationMs,
498+
durationMs: durationMs,
499499
});
500500
// `.current` is marked as readonly, but it's safe to set the value from
501501
// inside a `useEffect` hook.

static/app/components/replays/videoReplayer.spec.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe('VideoReplayer - no starting gap', () => {
8787
onFinished: jest.fn(),
8888
onLoaded: jest.fn(),
8989
onBuffer: jest.fn(),
90-
duration: 40,
90+
durationMs: 40,
9191
});
9292
// @ts-expect-error private
9393
expect(inst._currentIndex).toEqual(0);
@@ -113,7 +113,7 @@ describe('VideoReplayer - no starting gap', () => {
113113
onFinished: jest.fn(),
114114
onLoaded: jest.fn(),
115115
onBuffer: jest.fn(),
116-
duration: 40,
116+
durationMs: 40,
117117
});
118118
const playPromise = inst.play(18100);
119119
// @ts-expect-error private
@@ -142,7 +142,7 @@ describe('VideoReplayer - no starting gap', () => {
142142
onFinished: jest.fn(),
143143
onLoaded: jest.fn(),
144144
onBuffer: jest.fn(),
145-
duration: 40,
145+
durationMs: 40,
146146
});
147147
const playPromise = inst.play(50000);
148148
// 15000 -> 20000 is a gap, so player should start playing @ index 3, from
@@ -165,7 +165,7 @@ describe('VideoReplayer - no starting gap', () => {
165165
onFinished: jest.fn(),
166166
onLoaded: jest.fn(),
167167
onBuffer: jest.fn(),
168-
duration: 40,
168+
durationMs: 40,
169169
});
170170
const playPromise = inst.play(0);
171171
jest.advanceTimersByTime(2500);
@@ -185,7 +185,7 @@ describe('VideoReplayer - no starting gap', () => {
185185
onFinished: jest.fn(),
186186
onLoaded: jest.fn(),
187187
onBuffer: jest.fn(),
188-
duration: 50,
188+
durationMs: 50,
189189
});
190190
// play at segment 7
191191
const playPromise = inst.play(45_003);
@@ -220,7 +220,7 @@ describe('VideoReplayer - no starting gap', () => {
220220
onFinished: jest.fn(),
221221
onLoaded: jest.fn(),
222222
onBuffer: jest.fn(),
223-
duration: 60,
223+
durationMs: 60,
224224
});
225225
// play at segment 7
226226
const playPromise = inst.play(45_003);
@@ -294,7 +294,7 @@ describe('VideoReplayer - with starting gap', () => {
294294
onFinished: jest.fn(),
295295
onLoaded: jest.fn(),
296296
onBuffer: jest.fn(),
297-
duration: 40,
297+
durationMs: 40,
298298
});
299299
// @ts-expect-error private
300300
expect(inst._currentIndex).toEqual(0);
@@ -318,7 +318,7 @@ describe('VideoReplayer - with starting gap', () => {
318318
onFinished: jest.fn(),
319319
onLoaded: jest.fn(),
320320
onBuffer: jest.fn(),
321-
duration: 40,
321+
durationMs: 40,
322322
});
323323
const playPromise = inst.play(18100);
324324
// @ts-expect-error private
@@ -347,7 +347,7 @@ describe('VideoReplayer - with starting gap', () => {
347347
onFinished: jest.fn(),
348348
onLoaded: jest.fn(),
349349
onBuffer: jest.fn(),
350-
duration: 40,
350+
durationMs: 40,
351351
});
352352
const playPromise = inst.play(50000);
353353
// 15000 -> 20000 is a gap, so player should start playing @ index 3, from

static/app/components/replays/videoReplayer.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface OffsetOptions {
1414
}
1515

1616
interface VideoReplayerOptions {
17-
duration: number;
17+
durationMs: number;
1818
onBuffer: (isBuffering: boolean) => void;
1919
onFinished: () => void;
2020
onLoaded: (event: any) => void;
@@ -57,7 +57,7 @@ export class VideoReplayer {
5757
private _videos: Map<any, HTMLVideoElement>;
5858
private _videoApiPrefix: string;
5959
private _clipDuration: number | undefined;
60-
private _duration: number;
60+
private _durationMs: number;
6161
public config: VideoReplayerConfig = {
6262
skipInactive: false,
6363
speed: 1.0,
@@ -75,7 +75,7 @@ export class VideoReplayer {
7575
onFinished,
7676
onLoaded,
7777
clipWindow,
78-
duration,
78+
durationMs,
7979
}: VideoReplayerOptions
8080
) {
8181
this._attachments = attachments;
@@ -89,7 +89,7 @@ export class VideoReplayer {
8989
};
9090
this._videos = new Map<any, HTMLVideoElement>();
9191
this._clipDuration = undefined;
92-
this._duration = duration;
92+
this._durationMs = durationMs;
9393

9494
this.wrapper = document.createElement('div');
9595
if (root) {
@@ -304,7 +304,7 @@ export class VideoReplayer {
304304
// If we're at the end of a segment, but there's a gap
305305
// at the end, force the replay to play until the end duration
306306
// rather than stopping right away.
307-
this._timer.addNotificationAtTime(this._duration, () => {
307+
this._timer.addNotificationAtTime(this._durationMs, () => {
308308
this.stopReplay();
309309
});
310310
return;
@@ -611,7 +611,7 @@ export class VideoReplayer {
611611
// at the end of the replay.
612612
// This tells the timer to stop at the specified duration
613613
// and prevents the timer from running infinitely.
614-
this._timer.addNotificationAtTime(this._duration, () => {
614+
this._timer.addNotificationAtTime(this._durationMs, () => {
615615
this.stopReplay();
616616
});
617617
return Promise.resolve();

0 commit comments

Comments
 (0)