Class: shaka.util.FakeEventTarget

Constructor

(export) new FakeEventTarget()

A work-alike for EventTarget. Only DOM elements may be true EventTargets, but this can be used as a base class to provide event dispatch to non-DOM classes. Only FakeEvents should be dispatched.
Implements:
  • EventTarget
Source:

Members

dispatchTarget :EventTarget

The target of all dispatched events. Defaults to |this|.
Type:
  • EventTarget
Source:

Methods

(export) addEventListener(type, listener, optionsopt)

Add an event listener to this object.
Parameters:
Name Type Attributes Description
type string The event type to listen for.
listener shaka.util.FakeEventTarget.ListenerType The callback or listener object to invoke.
options AddEventListenerOptions | boolean <optional>
Ignored.
Source:

(export) dispatchEvent(eventnon-null) → {boolean}

Dispatch an event from this object.
Parameters:
Name Type Description
event Event The event to be dispatched from this object.
Source:
Returns:
True if the default action was prevented.
Type
boolean

(export) removeEventListener(type, listener, optionsopt)

Remove an event listener from this object.
Parameters:
Name Type Attributes Description
type string The event type for which you wish to remove a listener.
listener shaka.util.FakeEventTarget.ListenerType The callback or listener object to remove.
options EventListenerOptions | boolean <optional>
Ignored.
Source:

Type Definitions

(export) ListenerType()

These are the listener types defined in the closure extern for EventTarget.
Source: