diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74433ab..7628ff3 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -129,6 +129,8 @@ frame = new math.Rectangle(0, 0, baseTexture.width, baseTexture.height); } this.frame = frame; + + } else { @@ -215,7 +217,7 @@ this.frame = this._frame; } - this.dispatchEvent( { type: 'update', content: this } ); + this.emit( 'update', this ); }; /** @@ -317,6 +319,11 @@ return new Texture(VideoBaseTexture.baseTextureFromVideo(video, scaleMode)); }; +Texture.fromVideoUrl = function (videoUrl, scaleMode) +{ + return new Texture(VideoBaseTexture.fromUrl(videoUrl, scaleMode)); +}; + /** * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 74433ab..7628ff3 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -129,6 +129,8 @@ frame = new math.Rectangle(0, 0, baseTexture.width, baseTexture.height); } this.frame = frame; + + } else { @@ -215,7 +217,7 @@ this.frame = this._frame; } - this.dispatchEvent( { type: 'update', content: this } ); + this.emit( 'update', this ); }; /** @@ -317,6 +319,11 @@ return new Texture(VideoBaseTexture.baseTextureFromVideo(video, scaleMode)); }; +Texture.fromVideoUrl = function (videoUrl, scaleMode) +{ + return new Texture(VideoBaseTexture.fromUrl(videoUrl, scaleMode)); +}; + /** * Adds a texture to the global utils.TextureCache. This cache is shared across the whole PIXI object. * diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index 7ead661..b323184 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -213,7 +213,7 @@ video.load(); video.play(); - return VideoBaseTexture.textureFromVideo(video, scaleMode); + return VideoBaseTexture.fromVideo(video, scaleMode); }; VideoBaseTexture.fromUrls = VideoBaseTexture.fromUrl;