loomse

Loomse

Instance methods

currentDuration()

Returns number

Returns the length of the current media track (in seconds)

currentEvents()

Returns scriptedEvent[]

Returns a collection of events for the current scene

currentScene()

Returns string

Returns the current scene name

currentTime()

Returns number

Returns the time index of the current media (in seconds)

pause()

Pauses the current media track

play()

Plays the current media track

reloadScene()

Reloads the current scene

registerPlugin(pluginProps)

Parameters

pluginProps PluginProps

An object with some or all of the following properties:

name string

The name of the plugin. Must be unique

mount? object (optional)

Specifies the mount behaviour for the plugin

parentEl: HTMLElement

The parent container where the plugin will be mounted

el: HTMLElement;

The container for the plugin

onLoad? boolean (optional)

Should the plugin be mounted when Loomse initialises?

persist? boolean (optional)

Keeps the plugin mounted to the DOM

hooks? object (optional)

run? function (optional)

The callback which should execute when the plugin is called via an event

cleanup? function (optional)

The callback which should execute before unmounting the plugin

changeScene(sceneName)

Skips to the named scene

Parameters

sceneName string

Instance properties

el

Returns HTMLElement

The root element where Loomse is registered