Skip to content

Commit 0b4b971

Browse files
author
Anonymous
authored
Correct breaking canvas example JS (#3908)
This corrects a regression introduced in 130a8df
1 parent bd89dc4 commit 0b4b971

File tree

1 file changed

+2
-3
lines changed
  • files/en-us/web/api/canvas_api/manipulating_video_using_canvas

1 file changed

+2
-3
lines changed

files/en-us/web/api/canvas_api/manipulating_video_using_canvas/index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,9 @@ <h3 id="Manipulating_the_video_frame_data">Manipulating the video frame data</h3
125125
<pre class="brush: js"> processor.computeFrame = function computeFrame() {
126126
this.ctx1.drawImage(this.video, 0, 0, this.width, this.height);
127127
const frame = this.ctx1.getImageData(0, 0, this.width, this.height);
128-
const data = frame.data;
129-
    const l = data.length / 4;
128+
    const length = frame.data.length;
130129

131-
for (let i = 0; i &lt; l; i += 4) {
130+
for (let i = 0; i &lt; length; i += 4) {
132131
const red = data[i + 0];
133132
const green = data[i + 1];
134133
const blue = data[i + 2];

0 commit comments

Comments
 (0)