2016-10-08 15:17:46 +00:00
|
|
|
/**
|
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
|
|
* @copyright 2016 Photon Storm Ltd.
|
|
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
|
|
*/
|
|
|
|
|
2016-10-09 21:27:58 +00:00
|
|
|
Phaser.GameObject.Video.FACTORY_KEY = 'video';
|
2016-10-08 15:17:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a Video object.
|
|
|
|
*
|
|
|
|
* This will return a Phaser.Video object which you can pass to a Sprite to be used as a texture.
|
|
|
|
*
|
2016-10-09 21:27:58 +00:00
|
|
|
* @method Phaser.GameObject.Factory#video
|
2016-10-08 15:17:46 +00:00
|
|
|
* @param {string|null} [key=null] - The key of the video file in the Phaser.Cache that this Video object will play. Set to `null` or leave undefined if you wish to use a webcam as the source. See `startMediaStream` to start webcam capture.
|
|
|
|
* @param {string|null} [url=null] - If the video hasn't been loaded then you can provide a full URL to the file here (make sure to set key to null)
|
|
|
|
* @return {Phaser.Video} The newly created Video object.
|
|
|
|
*/
|
2016-10-09 21:27:58 +00:00
|
|
|
Phaser.GameObject.Video.FACTORY_ADD = function (key, url)
|
2016-10-08 15:17:46 +00:00
|
|
|
{
|
2016-10-09 21:27:58 +00:00
|
|
|
return new Phaser.GameObject.Video(this.game, key, url);
|
2016-10-08 15:17:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a Video object.
|
|
|
|
*
|
|
|
|
* This will return a Phaser.Video object which you can pass to a Sprite to be used as a texture.
|
|
|
|
*
|
2016-10-09 21:27:58 +00:00
|
|
|
* @method Phaser.GameObject.Factory#video
|
2016-10-08 15:17:46 +00:00
|
|
|
* @param {string|null} [key=null] - The key of the video file in the Phaser.Cache that this Video object will play. Set to `null` or leave undefined if you wish to use a webcam as the source. See `startMediaStream` to start webcam capture.
|
|
|
|
* @param {string|null} [url=null] - If the video hasn't been loaded then you can provide a full URL to the file here (make sure to set key to null)
|
|
|
|
* @return {Phaser.Video} The newly created Video object.
|
|
|
|
*/
|
2016-10-09 21:27:58 +00:00
|
|
|
Phaser.GameObject.Video.FACTORY_MAKE = function (key, url)
|
2016-10-08 15:17:46 +00:00
|
|
|
{
|
2016-10-09 21:27:58 +00:00
|
|
|
return new Phaser.GameObject.Video(this.game, key, url);
|
2016-10-08 15:17:46 +00:00
|
|
|
};
|