()
| 646 | } |
| 647 | |
| 648 | async convertToArrayBuffer() { |
| 649 | this.video.pause(); |
| 650 | let d = this.video.duration; |
| 651 | let name = this.name; |
| 652 | for (let i = 0; i < d * fps; ++i) { |
| 653 | let frame = await this.seek(i / fps); |
| 654 | let sum = 0; |
| 655 | for (let j = 0; j < frame.data.length; ++j) { |
| 656 | sum += frame.data[j]; |
| 657 | } |
| 658 | this.frames.push(frame); |
| 659 | this.update_name((100 * i / (d * fps)).toFixed(2) + "%"); |
| 660 | } |
| 661 | this.ready = true; |
| 662 | this.video.remove(); |
| 663 | this.video = null; |
| 664 | this.update_name(name); |
| 665 | } |
| 666 | |
| 667 | render(ctx_out, ref_time) { |
| 668 | if (!this.ready) { |
no test coverage detected