SamPotasz Posted May 15, 2017 Share Posted May 15, 2017 Hi y'all, I'm having trouble getting the Webcam plugin running in my game for some reason. Seems like it should be simple enough judging by the example: https://phaser.io/examples/v2/misc/webcam When I start the plugin from inside my Game state, the plugin starts, my browser asks for permission to access the camera, and then I get a completely blank screen - no output from the camera. Or the output is printing somewhere that's not being added to the game. Here's my code: BasicGame.Game = function(game) {}; BasicGame.Game.prototype = { preload: function() { this.game.load.script('webcam', '/src/utils/Webcam.js'); }, create: function() { var webcam = this.game.plugins.add(Phaser.Plugin.Webcam); console.log(this.game.plugins.plugins); var bmd = this.game.make.bitmapData(600, 450); var sprite = bmd.addToWorld(); webcam.start(600, 450, bmd.context); }, update: function() { }, }; The plugin is definitely added and then started so I really don't know what the issue is! Any help is appreciated :-) Thanks, Sam Link to comment Share on other sites More sharing options...
SamPotasz Posted May 15, 2017 Author Share Posted May 15, 2017 Oh, and Webcam.js is taken from https://github.com/photonstorm/phaser-plugins/blob/master/Webcam/Webcam.js Link to comment Share on other sites More sharing options...
Recommended Posts