Skip to main content
Version: Phaser v4.0.0

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

nametypeoptionaldefaultdescription
loaderPhaser.Loader.LoaderPluginNoA reference to the Loader that is responsible for this file.
keystring | Phaser.Types.Loader.FileTypes.VideoFileConfigNoThe key to use for this file, or a file configuration object.
urlsstring | Array.<string>Phaser.Types.Loader.FileTypes.VideoFileURLConfigArray.<Phaser.Types.Loader.FileTypes.VideoFileURLConfig>Yes
noAudiobooleanYesfalseDoes the video have an audio track? If not you can enable auto-playing on it.

Scope: static

Extends

Phaser.Loader.File

Source: src/loader/filetypes/VideoFile.js#L15
Since: 3.20.0

Inherited Methods

From Phaser.Loader.File:


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: