VideoFile
A single Video File suitable for loading by the Loader.
These are created when you use the Phaser.Loader.LoaderPlugin#video method and are not typically created directly.
For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#video.
Constructor
new VideoFile(loader, key, [urls], [noAudio])
Parameters
| name | type | optional | default | description |
|---|---|---|---|---|
| loader | Phaser.Loader.LoaderPlugin | No | A reference to the Loader that is responsible for this file. | |
| key | string | Phaser.Types.Loader.FileTypes.VideoFileConfig | No | The key to use for this file, or a file configuration object. | |
| urls | string | Array.<string> | Phaser.Types.Loader.FileTypes.VideoFileURLConfig | Array.<Phaser.Types.Loader.FileTypes.VideoFileURLConfig> | Yes |
| noAudio | boolean | Yes | false | Does the video have an audio track? If not you can enable auto-playing on it. |
Scope: static
Extends
Source: src/loader/filetypes/VideoFile.js#L15
Since: 3.20.0
Inherited Methods
From Phaser.Loader.File:
- addToCache
- destroy
- hasCacheConflict
- onBase64Load
- onError
- onLoad
- onProcessComplete
- onProcessError
- onProgress
- pendingDestroy
- resetXHR
- setLink
Public Methods
load
<instance> load()
Description:
Called by the Loader to process this file. Unlike most file types, VideoFile does not perform an XHR request or download the video data during this step. Instead, it resolves the final URL and immediately marks the file as loaded, so the Loader can continue. The actual video content is fetched later by the Video Game Object when it needs to play it. You shouldn't normally call this method directly, it's meant to be invoked by the Loader.
Overrides: Phaser.Loader.File#load
Source: src/loader/filetypes/VideoFile.js#L94
Since: 3.20.0
onProcess
<instance> onProcess()
Description:
Called automatically by Loader.nextFile. This method assembles the processed data object for this file, storing the resolved URL, the noAudio flag, and the cross-origin setting so that a Video Game Object can use them to load the video at the appropriate time.
Overrides: Phaser.Loader.File#onProcess
Source: src/loader/filetypes/VideoFile.js#L74
Since: 3.20.0
Inherited Members
From Phaser.Loader.File:
- base64
- bytesLoaded
- bytesTotal
- cache
- config
- crossOrigin
- data
- key
- linkFile
- loader
- multiFile
- percentComplete
- retryAttempts
- src
- state
- type
- url
- xhrLoader
- xhrSettings