Skip to content

Commit 5fd91c1

Browse files
committed
fix: AVCanvas displays a black frame when played to the last frame
1 parent 7d3abdf commit 5fd91c1

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/pink-papayas-trade.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@webav/av-canvas': patch
3+
---
4+
5+
fix: AVCanvas displays a black frame when played to the last frame

packages/av-canvas/src/av-canvas.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,12 @@ export class AVCanvas {
189189
const cvsCtx = this.#cvsCtx;
190190
let ts = this.#renderTime;
191191
const { start, end, step, audioPlayAt } = this.#playState;
192+
ts += step;
192193
if (step !== 0 && ts >= start && ts < end) {
193-
ts += step;
194+
this.#updateRenderTime(ts);
194195
} else {
195196
this.#pause();
196197
}
197-
this.#updateRenderTime(ts);
198198

199199
const ctxDestAudioData: Float32Array[][] = [];
200200
for (const s of this.#spriteManager.getSprites()) {

0 commit comments

Comments
 (0)