MCPcopy Create free account
hub / github.com/bwasti/mebm / convertToArrayBuffer

Method convertToArrayBuffer

script.js:648–665  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers 1

constructorMethod · 0.95

Calls 4

seekMethod · 0.95
pauseMethod · 0.80
removeMethod · 0.80
update_nameMethod · 0.45

Tested by

no test coverage detected