mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 01:38:23 +00:00
Set the Video baseTexture to __default until the stream starts.
This commit is contained in:
parent
5458097006
commit
10a3df1ef5
1 changed files with 13 additions and 3 deletions
|
@ -136,8 +136,16 @@ Phaser.Video = function (game, key) {
|
|||
* @property {PIXI.BaseTexture} baseTexture - The PIXI.BaseTexture.
|
||||
* @default
|
||||
*/
|
||||
if (this.video)
|
||||
{
|
||||
this.baseTexture = new PIXI.BaseTexture(this.video);
|
||||
this.baseTexture.forceLoaded(this.width, this.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.baseTexture = new PIXI.BaseTexture(PIXI.TextureCache['__default'].baseTexture.source);
|
||||
this.baseTexture.forceLoaded(this.width, this.height);
|
||||
}
|
||||
|
||||
/**
|
||||
* @property {PIXI.Texture} texture - The PIXI.Texture.
|
||||
|
@ -288,13 +296,15 @@ Phaser.Video.prototype = {
|
|||
{
|
||||
// Patch for Firefox bug where the height can't be read from the video
|
||||
var width = self.video.videoWidth;
|
||||
var height = self.video.videoHeight;
|
||||
|
||||
if (isNaN(self.video.videoHeight))
|
||||
{
|
||||
var height = width / (4/3);
|
||||
height = width / (4/3);
|
||||
}
|
||||
|
||||
self.isStreaming = true;
|
||||
self.baseTexture.source = self.video;
|
||||
self.updateTexture(null, width, height);
|
||||
self.onAccess.dispatch(self);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue