Interface: VideoEventsMap

Phaser.Types.GameObjects.Video. VideoEventsMap

Extends

Methods


complete(video)

The Video Game Object Complete Event.

This event is dispatched when a Video finishes playback by reaching the end of its duration. It is also dispatched if a video marker sequence is being played and reaches the end.

Note that not all videos can fire this event. Live streams, for example, have no fixed duration, so never technically 'complete'.

If a video is stopped from playback, via the Video.stop method, it will emit the VIDEO_STOP event instead of this one.

Listen for it from a Video Game Object instance using Video.on('complete', listener).

Parameters:
Name Type Description
video Phaser.GameObjects.Video

The Video Game Object which completed playback.

Since: 3.20.0
Source: src/gameobjects/events/VIDEO_COMPLETE_EVENT.js (Line 28)

created(video, width, height)

The Video Game Object Created Event.

This event is dispatched when the texture for a Video has been created. This happens when enough of the video source has been loaded that the browser is able to render a frame from it.

Listen for it from a Video Game Object instance using Video.on('created', listener).

Parameters:
Name Type Description
video Phaser.GameObjects.Video

The Video Game Object which raised the event.

width integer

The width of the video.

height integer

The height of the video.

Since: 3.20.0
Source: src/gameobjects/events/VIDEO_CREATED_EVENT.js (Line 25)

destroy(gameObject)

The Game Object Destroy Event.

This event is dispatched when a Game Object instance is being destroyed.

Listen for it on a Game Object instance using GameObject.on('destroy', listener).

Parameters:
Name Type Description
gameObject Phaser.GameObjects.GameObject

The Game Object which is being destroyed.

Since: 3.0.0
Inherited From:
Source: src/gameobjects/events/DESTROY_EVENT.js (Line 21)

drag(pointer, dragX, dragY)

The Game Object Drag Event.

This event is dispatched by an interactive Game Object if a pointer moves while dragging it.

Listen to this event from a Game Object using: gameObject.on('drag', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive and enabled for drag. See GameObject.setInteractive for more details.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

dragX number

The x coordinate where the Pointer is currently dragging the Game Object, in world space.

dragY number

The y coordinate where the Pointer is currently dragging the Game Object, in world space.

Since: 3.0.0
Inherited From:
Source: src/input/events/GAMEOBJECT_DRAG_EVENT.js (Line 27)

dragend(pointer, dragX, dragY)

The Game Object Drag End Event.

This event is dispatched by an interactive Game Object if a pointer stops dragging it.

Listen to this event from a Game Object using: gameObject.on('dragend', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive and enabled for drag. See GameObject.setInteractive for more details.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

dragX number

The x coordinate where the Pointer stopped dragging the Game Object, in world space.

dragY number

The y coordinate where the Pointer stopped dragging the Game Object, in world space.

Since: 3.0.0
Inherited From:
Source: src/input/events/GAMEOBJECT_DRAG_END_EVENT.js (Line 27)

dragenter(pointer, target)

The Game Object Drag Enter Event.

This event is dispatched by an interactive Game Object if a pointer drags it into a drag target.

Listen to this event from a Game Object using: gameObject.on('dragenter', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive and enabled for drag. See GameObject.setInteractive for more details.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

target Phaser.GameObjects.GameObject

The drag target that this pointer has moved into.

Since: 3.0.0
Inherited From:
Source: src/input/events/GAMEOBJECT_DRAG_ENTER_EVENT.js (Line 26)

dragleave(pointer, target)

The Game Object Drag Leave Event.

This event is dispatched by an interactive Game Object if a pointer drags it out of a drag target.

Listen to this event from a Game Object using: gameObject.on('dragleave', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive and enabled for drag. See GameObject.setInteractive for more details.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

target Phaser.GameObjects.GameObject

The drag target that this pointer has left.

Since: 3.0.0
Inherited From:
Source: src/input/events/GAMEOBJECT_DRAG_LEAVE_EVENT.js (Line 26)

dragover(pointer, target)

The Game Object Drag Over Event.

This event is dispatched by an interactive Game Object if a pointer drags it over a drag target.

When the Game Object first enters the drag target it will emit a dragenter event. If it then moves while within the drag target, it will emit this event instead.

Listen to this event from a Game Object using: gameObject.on('dragover', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive and enabled for drag. See GameObject.setInteractive for more details.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

target Phaser.GameObjects.GameObject

The drag target that this pointer has moved over.

Since: 3.0.0
Inherited From:
Source: src/input/events/GAMEOBJECT_DRAG_OVER_EVENT.js (Line 29)

dragstart(pointer, dragX, dragY)

The Game Object Drag Start Event.

This event is dispatched by an interactive Game Object if a pointer starts to drag it.

Listen to this event from a Game Object using: gameObject.on('dragstart', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive and enabled for drag. See GameObject.setInteractive for more details.

There are lots of useful drag related properties that are set within the Game Object when dragging occurs. For example, gameObject.input.dragStartX, dragStartY and so on.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

dragX number

The x coordinate where the Pointer is currently dragging the Game Object, in world space.

dragY number

The y coordinate where the Pointer is currently dragging the Game Object, in world space.

Since: 3.0.0
Inherited From:
Source: src/input/events/GAMEOBJECT_DRAG_START_EVENT.js (Line 30)

drop(pointer, target)

The Game Object Drop Event.

This event is dispatched by an interactive Game Object if a pointer drops it on a Drag Target.

Listen to this event from a Game Object using: gameObject.on('drop', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive and enabled for drag. See GameObject.setInteractive for more details.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

target Phaser.GameObjects.GameObject

The Drag Target the gameObject has been dropped on.

Since: 3.0.0
Inherited From:
Source: src/input/events/GAMEOBJECT_DROP_EVENT.js (Line 26)

error(video, event)

The Video Game Object Error Event.

This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type.

Listen for it from a Video Game Object instance using Video.on('error', listener).

Parameters:
Name Type Description
video Phaser.GameObjects.Video

The Video Game Object which threw the error.

event Event

The native DOM event the browser raised during playback.

Since: 3.20.0
Source: src/gameobjects/events/VIDEO_ERROR_EVENT.js (Line 22)

loop(video)

The Video Game Object Loop Event.

This event is dispatched when a Video that is currently playing has looped. This only happens if the loop parameter was specified, or the setLoop method was called, and if the video has a fixed duration. Video streams, for example, cannot loop, as they have no duration.

Looping is based on the result of the Video timeupdate event. This event is not frame-accurate, due to the way browsers work, so please do not rely on this loop event to be time or frame precise.

Listen for it from a Video Game Object instance using Video.on('loop', listener).

Parameters:
Name Type Description
video Phaser.GameObjects.Video

The Video Game Object which has looped.

Since: 3.20.0
Source: src/gameobjects/events/VIDEO_LOOP_EVENT.js (Line 28)

play(video)

The Video Game Object Play Event.

This event is dispatched when a Video begins playback. For videos that do not require interaction unlocking, this is usually as soon as the Video.play method is called. However, for videos that require unlocking, it is fired once playback begins after they've been unlocked.

Listen for it from a Video Game Object instance using Video.on('play', listener).

Parameters:
Name Type Description
video Phaser.GameObjects.Video

The Video Game Object which started playback.

Since: 3.20.0
Source: src/gameobjects/events/VIDEO_PLAY_EVENT.js (Line 24)

pointerdown(pointer, localX, localY, event)

The Game Object Pointer Down Event.

This event is dispatched by an interactive Game Object if a pointer is pressed down on it.

Listen to this event from a Game Object using: gameObject.on('pointerdown', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive. See GameObject.setInteractive for more details.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_DOWN
  2. GAMEOBJECT_DOWN
  3. POINTER_DOWN or POINTER_DOWN_OUTSIDE

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

localX number

The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

localY number

The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Inherited From:
Source: src/input/events/GAMEOBJECT_POINTER_DOWN_EVENT.js (Line 37)

pointermove(pointer, localX, localY, event)

The Game Object Pointer Move Event.

This event is dispatched by an interactive Game Object if a pointer is moved while over it.

Listen to this event from a Game Object using: gameObject.on('pointermove', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive. See GameObject.setInteractive for more details.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_MOVE
  2. GAMEOBJECT_MOVE
  3. POINTER_MOVE

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

localX number

The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

localY number

The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Inherited From:
Source: src/input/events/GAMEOBJECT_POINTER_MOVE_EVENT.js (Line 37)

pointerout(pointer, event)

The Game Object Pointer Out Event.

This event is dispatched by an interactive Game Object if a pointer moves out of it.

Listen to this event from a Game Object using: gameObject.on('pointerout', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive. See GameObject.setInteractive for more details.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_OUT
  2. GAMEOBJECT_OUT
  3. POINTER_OUT

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Inherited From:
Source: src/input/events/GAMEOBJECT_POINTER_OUT_EVENT.js (Line 35)

pointerover(pointer, localX, localY, event)

The Game Object Pointer Over Event.

This event is dispatched by an interactive Game Object if a pointer moves over it.

Listen to this event from a Game Object using: gameObject.on('pointerover', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive. See GameObject.setInteractive for more details.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_OVER
  2. GAMEOBJECT_OVER
  3. POINTER_OVER

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

localX number

The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

localY number

The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Inherited From:
Source: src/input/events/GAMEOBJECT_POINTER_OVER_EVENT.js (Line 37)

pointerup(pointer, localX, localY, event)

The Game Object Pointer Up Event.

This event is dispatched by an interactive Game Object if a pointer is released while over it.

Listen to this event from a Game Object using: gameObject.on('pointerup', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive. See GameObject.setInteractive for more details.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_UP
  2. GAMEOBJECT_UP
  3. POINTER_UP or POINTER_UP_OUTSIDE

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

localX number

The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

localY number

The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Inherited From:
Source: src/input/events/GAMEOBJECT_POINTER_UP_EVENT.js (Line 37)

seeked(video)

The Video Game Object Seeked Event.

This event is dispatched when a Video completes seeking to a new point in its timeline.

Listen for it from a Video Game Object instance using Video.on('seeked', listener).

Parameters:
Name Type Description
video Phaser.GameObjects.Video

The Video Game Object which completed seeking.

Since: 3.20.0
Source: src/gameobjects/events/VIDEO_SEEKED_EVENT.js (Line 21)

seeking(video)

The Video Game Object Seeking Event.

This event is dispatched when a Video begins seeking to a new point in its timeline. When the seek is complete, it will dispatch the VIDEO_SEEKED event to conclude.

Listen for it from a Video Game Object instance using Video.on('seeking', listener).

Parameters:
Name Type Description
video Phaser.GameObjects.Video

The Video Game Object which started seeking.

Since: 3.20.0
Source: src/gameobjects/events/VIDEO_SEEKING_EVENT.js (Line 22)

stop(video)

The Video Game Object Stopped Event.

This event is dispatched when a Video is stopped from playback via a call to the Video.stop method, either directly via game code, or indirectly as the result of changing a video source or destroying it.

Listen for it from a Video Game Object instance using Video.on('stop', listener).

Parameters:
Name Type Description
video Phaser.GameObjects.Video

The Video Game Object which stopped playback.

Since: 3.20.0
Source: src/gameobjects/events/VIDEO_STOP_EVENT.js (Line 22)

timeout(video)

The Video Game Object Timeout Event.

This event is dispatched when a Video has exhausted its allocated time while trying to connect to a video source to start playback.

Listen for it from a Video Game Object instance using Video.on('timeout', listener).

Parameters:
Name Type Description
video Phaser.GameObjects.Video

The Video Game Object which timed out.

Since: 3.20.0
Source: src/gameobjects/events/VIDEO_TIMEOUT_EVENT.js (Line 22)

unlocked(video)

The Video Game Object Unlocked Event.

This event is dispatched when a Video that was prevented from playback due to the browsers Media Engagement Interaction policy, is unlocked by a user gesture.

Listen for it from a Video Game Object instance using Video.on('unlocked', listener).

Parameters:
Name Type Description
video Phaser.GameObjects.Video

The Video Game Object which raised the event.

Since: 3.20.0
Source: src/gameobjects/events/VIDEO_UNLOCKED_EVENT.js (Line 22)

wheel(pointer, deltaX, deltaY, deltaZ, event)

The Game Object Pointer Wheel Event.

This event is dispatched by an interactive Game Object if a pointer has its wheel moved while over it.

Listen to this event from a Game Object using: gameObject.on('wheel', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive. See GameObject.setInteractive for more details.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_WHEEL
  2. GAMEOBJECT_WHEEL
  3. POINTER_WHEEL

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

deltaX number

The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device.

deltaY number

The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down.

deltaZ number

The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.18.0
Inherited From:
Source: src/input/events/GAMEOBJECT_POINTER_WHEEL_EVENT.js (Line 38)