Class: shaka.util.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.

Constructor

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:
Source:

Members

ALL_EVENTS_ :string

Type:
  • string
Source:

dispatchTarget :EventTarget

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

Methods

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:

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

listenToAllEvents(listener)

Add an event listener to this object that is invoked for all events types the object fires.
Parameters:
Name Type Description
listener shaka.util.FakeEventTarget.ListenerType The callback or listener object to invoke.
Source:

release()

Request that this object release all internal references.
Implements:
Source:

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

ListenerType()

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