Skip to content

Commit

Permalink
Merge pull request #72 from davedoesdev/master
Browse files Browse the repository at this point in the history
Set width and height before setFiltering is called
  • Loading branch information
patriciogonzalezvivo authored Oct 29, 2022
2 parents d478339 + 7d092c6 commit c8c5aa7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions dist/GlslCanvas.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,8 @@ var Texture = function () {
this.sourceType = 'element';

if (element instanceof HTMLVideoElement) {
this.width = this.source.videoWidth;
this.height = this.source.videoHeight;
element.addEventListener('canplaythrough', function () {
_this2.intervalID = setInterval(function () {
_this2.update(options);
Expand Down
2 changes: 2 additions & 0 deletions dist/GlslCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,8 @@ var Texture = function () {
this.sourceType = 'element';

if (element instanceof HTMLVideoElement) {
this.width = this.source.videoWidth;
this.height = this.source.videoHeight;
element.addEventListener('canplaythrough', function () {
_this2.intervalID = setInterval(function () {
_this2.update(options);
Expand Down
2 changes: 1 addition & 1 deletion dist/GlslCanvas.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/GlslCanvas.min.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions lib/GlslCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,8 @@ var Texture = function () {
this.sourceType = 'element';

if (element instanceof HTMLVideoElement) {
this.width = this.source.videoWidth;
this.height = this.source.videoHeight;
element.addEventListener('canplaythrough', function () {
_this2.intervalID = setInterval(function () {
_this2.update(options);
Expand Down
2 changes: 2 additions & 0 deletions src/gl/Texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ export default class Texture {
this.sourceType = 'element';

if (element instanceof HTMLVideoElement) {
this.width = this.source.videoWidth;
this.height = this.source.videoHeight;
element.addEventListener('canplaythrough', () => {
this.intervalID = setInterval(()=>{
this.update(options);
Expand Down

0 comments on commit c8c5aa7

Please sign in to comment.