Class: shaka.util.EventManager

An EventManager maintains a collection of "event bindings" between event targets and event listeners.

Constructor

new EventManager()

An EventManager maintains a collection of "event bindings" between event targets and event listeners.

Implements:
Source:

Classes

Binding_

Members

bindingMap_ :shaka.util.MultiMap.<!shaka.util.EventManager.Binding_>

Maps an event type to an array of event bindings.
Type:
Source:

Methods

listen(target, type, listener, optionsopt)

Attaches an event listener to an event target.
Parameters:
Name Type Attributes Description
target EventTarget The event target.
type string The event type.
listener shaka.util.EventManager.ListenerType The event listener.
options boolean | AddEventListenerOptions <optional>
An object that specifies characteristics about the event listener. The passive option, if true, indicates that this function will never call preventDefault(), which improves scrolling performance.
Source:

listenOnce(target, type, listener, optionsopt)

Attaches an event listener to an event target. The listener will be removed when the first instance of the event is fired.
Parameters:
Name Type Attributes Description
target EventTarget The event target.
type string The event type.
listener shaka.util.EventManager.ListenerType The event listener.
options boolean | AddEventListenerOptions <optional>
An object that specifies characteristics about the event listener. The passive option, if true, indicates that this function will never call preventDefault(), which improves scrolling performance.
Source:

release()

Detaches all event listeners.
Implements:
Source:

removeAll()

Detaches all event listeners from all targets.
Source:

unlisten(target, type, listeneropt)

Detaches an event listener from an event target.
Parameters:
Name Type Attributes Description
target EventTarget The event target.
type string The event type.
listener shaka.util.EventManager.ListenerType <optional>
The event listener.
Source:

Type Definitions

ListenerType

Type:
  • function(!Event)
Source: