MCPcopy
hub / github.com/ilyhalight/voice-over-translation / check

Function check

src/shims/rvfc-polyfill.ts:82–108  ·  view source on GitHub ↗
(old: number, now: number)

Source from the content-addressed store, hash-verified

80 const baseline = quality.presentedFrames;
81
82 const check = (old: number, now: number): void => {
83 const newquality = getPlaybackQuality(this);
84 const presentedFrames = newquality.presentedFrames;
85
86 if (presentedFrames > baseline) {
87 const processingDuration =
88 newquality.totalFrameDelay - quality.totalFrameDelay || 0;
89 const timediff = now - old;
90
91 callback(now, {
92 presentationTime: now + processingDuration * 1000,
93 expectedDisplayTime: now + timediff,
94 width: this.videoWidth,
95 height: this.videoHeight,
96 mediaTime: Math.max(0, this.currentTime || 0) + timediff / 1000,
97 presentedFrames,
98 processingDuration,
99 });
100
101 delete this._rvfcpolyfillmap?.[handle];
102 } else {
103 this._rvfcpolyfillmap ??= {};
104 this._rvfcpolyfillmap[handle] = requestAnimationFrame((newer) =>
105 check(now, newer),
106 );
107 }
108 };
109
110 this._rvfcpolyfillmap ??= {};
111 this._rvfcpolyfillmap[handle] = requestAnimationFrame((newer) =>

Callers 1

rvfc-polyfill.tsFile · 0.85

Calls 1

maxMethod · 0.80

Tested by

no test coverage detected