Skip to content

Commit

Permalink
chore: 🤖 pass the buffer without casting to Uint8ClampedArray
Browse files Browse the repository at this point in the history
  • Loading branch information
theashraf committed Jan 9, 2024
1 parent 9c702ba commit 5c8ceb3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions index.html → web-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@
if (!lastFrameTime || timestamp - lastFrameTime >= timePerFrame) {
player.frame(currentFrame);
const buffer = player.getBuffer();
const pixels = new Uint8ClampedArray(buffer);

imageData.data.set(pixels);
imageData.data.set(buffer);
ctx.putImageData(imageData, 0, 0);

currentFrame++;
Expand Down

0 comments on commit 5c8ceb3

Please sign in to comment.