Phaser API Documentation

  Version: 
getDuration()

Description:

A double-precision floating-point value which indicates the duration (total length) of the media in seconds, on the media's timeline. If no media is present on the element, or the media is not valid, the returned value is NaN.

If the media has no known end (such as for live streams of unknown duration, web radio, media incoming from WebRTC, and so forth), this value is +Infinity.

Returns:
Description:

A double-precision floating-point value indicating the duration of the media in seconds.

Type:
  • number
Since: 3.20.0