# PlayerEventType

> **PlayerEventType** = `"statechange"` | `"complete"` | `"play"` | `"pause"` | `"error"`

The events a `Player` sends (`player.on(type, listener)`):

- `statechange`: a state began: a trigger fired or was released, `play(state)` ran, `data-rupa-state` was set from
  outside, a chain looped back, or a run back ended and resumed what it interrupted. The root also dispatches the DOM
  event `rupastatechange` (`event.detail.state`) at the same moment.
- `complete`: the chain of the state that plays reached its end (a chain with an end and no loop back), once each
  time the state begins or is sought.
- `play`: the player runs again after `pause()`: `play()` went on, or a state began (a state always plays).
- `pause`: `pause()` froze it.
- `error`: something threw inside the player, which went inert (`fatal: true`, `error`): its CSS animations play on
  by themselves, every call of it does nothing from then on.

Mounting sends no event. A listener that calls the player (`play`, `seek`, …) is not interrupted: the call runs after
every listener of the event, in a task of its own.
