Refactored Video constructor significantly - you can no longer create a webcam stream from the constructor, as it doesn't give you time to respond to onAccess and onError signals in Firefox. Instead call startMediaStream directly having set-up your signal listeners first.
startMediaStream now has a chance to dispatch the onError signal if the webcam has been blocked entirely by the browser (auto-block or remembered block). autoPlay attribute removed to stop Firefox throwing a "Invalid URI. Load of media resource failed" error.
Tidied up Video.destroy to properly remove video element from the DOM.
In the demo (code below), i create a group with a rect mask, and create a sprite as child with a blurXY filter, then nothing is displayed.
So i hack WebGLFilterManager's pushFilter and popFilter method, in pushFilter method i create a new stencilManager instance and cache the old one, in popFilter i destroy the new stencilManager and restore the old one, then this workaround works rightly as i expect.
I think this is bug for PIXI, so i hope @GoodBoyDigital and @photonstorm can help me to check whether this fixing is right or not, thanks.
var game = new Phaser.Game(800, 600, Phaser.WEBGL, 'phaser-example', { preload: preload, create: create });
function preload() {
game.load.image('phaser', 'assets/sprites/phaser2.png');
game.load.script('filterX', '../filters/BlurX.js');
game.load.script('filterY', '../filters/BlurY.js');
}
function create() {
var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser');
logo.anchor.setTo(0.5, 0.5);
var blurX = game.add.filter('BlurX');
var blurY = game.add.filter('BlurY');
logo.filters = [blurX, blurY];
var group = game.add.group();
group.addChild(logo);
group.mask = game.add.graphics();
group.mask.beginFill(0xff);
group.mask.drawRect(0,0,500,500);
}