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:
NameTypeAttributesDescription
targetOrTypestring | Array | Element | Object

If this is a string or array, it represents the event type(s) that will trigger the listener.

  1. Another evented object can be passed here instead, which will
  2. cause the listener to listen for events on that object.
  3. In either case, the listeners this value will be bound to
  4. this object.
typeOrListenerstring | 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).

listenerfunction<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:
NameTypeAttributesDescription
targetOrTypestring | Array | Element | Object<optional>

If this is a string or array, it represents the event type(s).

  1. Another evented object can be passed here instead, in which case
  2. ALL 3 arguments are required.
typeOrListenerstring | 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).

listenerfunction<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:
NameTypeAttributesDescription
targetOrTypestring | Array | Element | Object

If this is a string or array, it represents the event type(s) that will trigger the listener.

  1. Another evented object can be passed here instead, which will
  2. cause the listener to listen for events on that object.
  3. In either case, the listeners this value will be bound to
  4. this object.
typeOrListenerstring | 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).

listenerfunction<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:
NameTypeAttributesDescription
targetOrTypestring | Array | Element | Object

If this is a string or array, it represents the event type(s) that will trigger the listener.

  1. Another evented object can be passed here instead, which will
  2. cause the listener to listen for events on that object.
  3. In either case, the listeners this value will be bound to
  4. this object.
typeOrListenerstring | 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).

listenerfunction<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:
NameTypeAttributesDescription
eventstring | Object

An event type or an object with a type property.

hashObject<optional>

An additional object to pass along to listeners.

Returns:

boolean -

Whether or not the default behavior was prevented.