removeEventListener
Description
Remove an event listener.
That is, remove a callback previously registered with addEventListener
from
being triggered on the corresponding event. This also free-up the corresponding
ressources.
The callback given is optional: if not given, every registered callback to that event will be removed.
Syntax
// Remove all callbacks linked to event
player.removeEventListener(event);
// Remove specific listener
player.removeEventListener(event, callback);
-
arguments:
-
event
string
: The event name. -
callback (optional)
Function
|undefined
: The callback given when calling the correspondingaddEventListener
API.
-
Example
player.removeEventListener("playerStateChange", listenerCallback);