Contains methods that provide statefulness to an object which is passed to module:stateful.
Members
static state :Object
[mixins/stateful.js](https://docs.videojs.com/mixins_stateful.js.html)
, [line 22](https://docs.videojs.com/mixins_stateful.js.html#line22)
A hash containing arbitrary keys and values representing the state of the object.
Methods
static setState(stateUpdates) → {Object|undefined}
[mixins/stateful.js](https://docs.videojs.com/mixins_stateful.js.html)
, [line 37](https://docs.videojs.com/mixins_stateful.js.html#line37)
Set the state of an object by mutating its state object in place.
Parameters:
Name | Type | Description |
---|---|---|
stateUpdates | Object | function | A new set of properties to shallow-merge into the plugin state. Can be a plain object or a function returning a plain object. |
Fires:
Returns:
Object | undefined -
An object containing changes that occurred. If no changes occurred, returns undefined
.
Events
statechanged
[mixins/stateful.js](https://docs.videojs.com/mixins_stateful.js.html)
, [line 66](https://docs.videojs.com/mixins_stateful.js.html#line66)
An event triggered on an object that is both stateful and evented indicating that its state has changed.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
changes | Object | A hash containing the properties that were changed and the values they were changed |