video(key, urls, loadEvent, asBlob) → {Phaser.Loader}
Adds a video file to the current load queue.
The file is not loaded immediately after calling this method. The file is added to the queue ready to be loaded when the loader starts.
The key must be a unique String. It is used to add the file to the Phaser.Cache upon successful load.
Retrieve the file via Cache.getVideo(key)
.
The URL can be relative or absolute. If the URL is relative the Loader.baseURL
and Loader.path
values will be prepended to it.
You don't need to preload a video in order to play it in your game. See Video.createVideoFromURL
for details.
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
key | string | Unique asset key of the video file. | ||
urls | string | Array.<string> | Array.<object> | Either a single string or an array of URIs or pairs of | ||
loadEvent | string | <optional> | 'canplaythrough' | This sets the Video source event to listen for before the load is considered complete. |
asBlob | boolean | <optional> | false | Video files can either be loaded via the creation of a video element which has its src property set. |
Returns
This Loader instance.
- Source code: loader/Loader.js (Line 1111)
Please login to continue.