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:
- EventTarget
- Source:
Members
-
dispatchTarget :EventTarget
-
The target of all dispatched events. Defaults to |this|.
Type:
- EventTarget
- Source:
-
(private, non-null) listeners_ :shaka.util.MultiMap.<shaka.util.FakeEventTarget.ListenerType>
-
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>
Ignored. FakeEventTargets do not have parents, so events neither capture nor bubble. - 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
-
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>
Ignored. FakeEventTargets do not have parents, so events neither capture nor bubble. - Source:
Type Definitions
-
ListenerType
-
These are the listener types defined in the closure extern for EventTarget.
Type:
- EventListener | function(!Event): (boolean|undefined)
- Source: