Contains methods that provide event capabilities to an object which is passed to evented.
Methods
static any(targetOrType, typeOrListener, listeneropt)
[mixins/evented.js](https://docs.videojs.com/mixins_evented.js.html)
, [line 357](https://docs.videojs.com/mixins_evented.js.html#line357)
Add a listener to an event (or events) on this object or another evented object. The listener will only be called once for the first event that is triggered then removed.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
targetOrType | string | Array | Element | Object | If this is a string or array, it represents the event type(s) that will trigger the listener.
| |
typeOrListener | string | Array | function | If the first argument was a string or array, this should be the listener function. Otherwise, this is a string or array of event type(s). | |
listener | function | <optional> | If the first argument was another evented object, this will be the listener function. |
static off(targetOrTypeopt, typeOrListeneropt, listeneropt)
[mixins/evented.js](https://docs.videojs.com/mixins_evented.js.html)
, [line 397](https://docs.videojs.com/mixins_evented.js.html#line397)
Removes listener(s) from event(s) on an evented object.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
targetOrType | string | Array | Element | Object | <optional> | If this is a string or array, it represents the event type(s).
|
typeOrListener | string | Array | function | <optional> | If the first argument was a string or array, this may be the listener function. Otherwise, this is a string or array of event type(s). |
listener | function | <optional> | If the first argument was another evented object, this will be the listener function; otherwise, all listeners bound to the event type(s) will be removed. |
static on(targetOrType, typeOrListener, listeneropt)
[mixins/evented.js](https://docs.videojs.com/mixins_evented.js.html)
, [line 256](https://docs.videojs.com/mixins_evented.js.html#line256)
Add a listener to an event (or events) on this object or another evented object.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
targetOrType | string | Array | Element | Object | If this is a string or array, it represents the event type(s) that will trigger the listener.
| |
typeOrListener | string | Array | function | If the first argument was a string or array, this should be the listener function. Otherwise, this is a string or array of event type(s). | |
listener | function | <optional> | If the first argument was another evented object, this will be the listener function. |
static one(targetOrType, typeOrListener, listeneropt)
[mixins/evented.js](https://docs.videojs.com/mixins_evented.js.html)
, [line 308](https://docs.videojs.com/mixins_evented.js.html#line308)
Add a listener to an event (or events) on this object or another evented object. The listener will be called once per event and then removed.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
targetOrType | string | Array | Element | Object | If this is a string or array, it represents the event type(s) that will trigger the listener.
| |
typeOrListener | string | Array | function | If the first argument was a string or array, this should be the listener function. Otherwise, this is a string or array of event type(s). | |
listener | function | <optional> | If the first argument was another evented object, this will be the listener function. |
static trigger(event, hashopt) → {boolean}
[mixins/evented.js](https://docs.videojs.com/mixins_evented.js.html)
, [line 442](https://docs.videojs.com/mixins_evented.js.html#line442)
Fire an event on this evented object, causing its listeners to be called.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event | string | Object | An event type or an object with a type property. | |
hash | Object | <optional> | An additional object to pass along to listeners. |
Returns:
boolean -
Whether or not the default behavior was prevented.