diff --git a/HISTORY.md b/HISTORY.md index abbde4f7..434c87c2 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -80,6 +80,7 @@ ### 2019-05-15 * Objects, Treads: refactored videoLayer so it can also be used for other extensions (maps, 3d) +* Objects: refactored video frame capture ### 2019-05-14 * Objects: fixed originalCloneName reference when setting a new parent diff --git a/src/objects.js b/src/objects.js index d7df87c6..4041a17a 100644 --- a/src/objects.js +++ b/src/objects.js @@ -7536,8 +7536,13 @@ StageMorph.prototype.step = function () { } // video frame capture + this.stepVideo(); +}; + +StageMorph.prototype.stepVideo = function () { + var context; if (this.videoElement) { - var context = this.projectionLayer().getContext('2d'); + context = this.projectionLayer().getContext('2d'); context.save(); if (this.mirrorVideo) { context.translate(this.dimensions.x, 0);