Constructor
(export) new EventManager()
An EventManager maintains a collection of "event bindings" between event targets and event listeners.
- Implements:
- Source:
Classes
Members
(private) bindingMap_ :shaka.util.MultiMap.<!shaka.util.EventManager.Binding_>
Maps an event type to an array of event bindings.
Type:
- Source:
Methods
(export) 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:
(export) 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:
(export) release()
Detaches all event listeners.
- Implements:
- Source:
(export) removeAll()
Detaches all event listeners from all targets.
- Source:
(export) 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: