Class: shaka.util.FakeEventTarget

Constructor

new FakeEventTarget(parent)

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.
Parameters:
Name Type Description
parent shaka.util.FakeEventTarget The parent for the purposes of event bubbling. Note that events on a FakeEventTarget can only bubble to other FakeEventTargets.
Implements:
  • EventTarget
Source:

Members

(private, non-null) listeners_ :shaka.util.MultiMap.<shaka.util.FakeEventTarget.ListenerType>

Type:
Source:

(protected) parent :shaka.util.FakeEventTarget

Type:
Source:

Methods

addEventListener(type, listener, opt_capturingopt)

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.
opt_capturing boolean <optional>
True to listen during the capturing phase, false to listen during the bubbling phase. Note that FakeEventTarget does not support the capturing phase from the standard event model.
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

(private) recursiveDispatch_(eventnon-null) → {boolean}

Dispatches an event recursively without changing its original target.
Parameters:
Name Type Description
event Event
Source:
Returns:
True if the default action was prevented.
Type
boolean

removeEventListener(type, listener, opt_capturingopt)

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.
opt_capturing boolean <optional>
True to remove a listener for the capturing phase, false to remove a listener for the bubbling phase. Note that FakeEventTarget does not support the capturing phase from the standard event model.
Source:

Type Definitions

ListenerType

These are the listener types defined in the closure extern for EventTarget.
Type:
  • EventListener | function(!Event): (boolean|undefined)
Source: