Added new Video events

This commit is contained in:
Richard Davey 2023-04-11 00:39:14 +01:00
parent 90654dedc1
commit 368cb4a146
3 changed files with 53 additions and 0 deletions

View file

@ -0,0 +1,22 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* The Video Game Object Playing Event.
*
* The playing event is fired after playback is first started,
* and whenever it is restarted. For example it is fired when playback
* resumes after having been paused or delayed due to lack of data.
*
* Listen for it from a Video Game Object instance using `Video.on('playing', listener)`.
*
* @event Phaser.GameObjects.Events#VIDEO_PLAYING
* @type {string}
* @since 3.60.0
*
* @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback.
*/
module.exports = 'playing';

View file

@ -0,0 +1,29 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* The Video Game Object Stalled Event.
*
* This event is dispatched by a Video Game Object when the video playback stalls.
*
* This can happen if the video is buffering, or if the video file is corrupt.
*
* If will fire for any of the following native DOM events:
*
* `stalled`
* `suspend`
* `waiting`
*
* Listen for it from a Video Game Object instance using `Video.on('stalled', listener)`.
*
* @event Phaser.GameObjects.Events#VIDEO_STALLED
* @type {string}
* @since 3.60.0
*
* @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error.
* @param {Event} event - The native DOM event the browser raised during playback.
*/
module.exports = 'stalled';

View file

@ -19,8 +19,10 @@ module.exports = {
VIDEO_LOCKED: require('./VIDEO_LOCKED_EVENT'),
VIDEO_LOOP: require('./VIDEO_LOOP_EVENT'),
VIDEO_PLAY: require('./VIDEO_PLAY_EVENT'),
VIDEO_PLAYING: require('./VIDEO_PLAYING_EVENT'),
VIDEO_SEEKED: require('./VIDEO_SEEKED_EVENT'),
VIDEO_SEEKING: require('./VIDEO_SEEKING_EVENT'),
VIDEO_STALLED: require('./VIDEO_STALLED_EVENT'),
VIDEO_STOP: require('./VIDEO_STOP_EVENT'),
VIDEO_TIMEOUT: require('./VIDEO_TIMEOUT_EVENT'),
VIDEO_UNLOCKED: require('./VIDEO_UNLOCKED_EVENT')