GameObjectFactory#video()

video(key, url) → {Phaser.Video}

Create a Video object.

This will return a Phaser.Video object which you can pass to a Sprite to be used as a texture.

Parameters
Name Type Argument Default Description
key string | null <optional>
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.

url string | null <optional>
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)

Returns

The newly created Video object.

Source code: gameobjects/GameObjectFactory.js (Line 510)
doc_phaser
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.