Skip to content

Module: src/util/convertTime

Converts time from seconds, SMPTE string or SMPTE Object. Returns an object containing all three representations.

Version
1.0.0
Author
Frank Kudermann - alphanull
License
MIT
Requires
object
Source
convertTime.js, line 3

Methods

static convertTime(value, frameRateopt) convertTime~smpteConversion|undefined

Converts time from seconds, SMPTE string or SMPTE Object. Returns an object containing all three representations.

Parameters:
Name Type Attributes Description
value string | number | convertTime~smpteFormat

The input value in one of the three accepted formats: seconds, a string or a module:src/util/convertTime~smpteFormat Object.

frameRate number optional

If frameRate is specified, adapt the conversion accordingly.

Returns

The converted value in three representations, or undefined if an error occurred.

Type convertTime~smpteConversion | undefined
Throws

If conversion fails due to type errors etc.

Type Error
Source
convertTime.js, line 20

Type Definitions

Properties
Name Type Description
smpte convertTime~smpteFormat

An object containing SMPTE values as properties.

string string

A string in the "hh:mm:ss:ff" format.

seconds number

Time in seconds.

Type
Object
Source
convertTime.js, line 89

Structure of the SMPTE Object

Properties
Name Type Description
h number

Hours.

m number

Minutes.

s number

Seconds.

f number

Frames.

Type
Object
Source
convertTime.js, line 96