---
title: stateDidChange
framework: tvmljs
role: symbol
role_heading: Instance Property
path: tvmljs/player/1627390-statedidchange
---

# stateDidChange

An event that indicates the state of the player has changed.

## Declaration

```data
attribute  stateDidChange;
```

## Discussion

Discussion The listener is passed an event object with the following attributes: duration—The duration, in seconds, of the asset being played. elapsedTime—The elapsed time, in seconds, of the asset being played. oldState—The previous state of the player. Valid values are playing, paused, and scanning. state—The state that the player is has switched to. Valid values are playing, paused, and scanning. target—The event object, which is the Player object. timeStamp—The time that the event occurred. type—The name of the event.

## See Also

### Responding to Events

- [mediaItemDidChange](tvmljs/player/1627385-mediaitemdidchange.md)
- [mediaItemWillChange](tvmljs/player/1627345-mediaitemwillchange.md)
- [playbackDidStall](tvmljs/player/1682114-playbackdidstall.md)
- [playbackError](tvmljs/player/1682115-playbackerror.md)
- [requestSeekToTime](tvmljs/player/1627354-requestseektotime.md)
- [shouldChangeToMediaAtIndex](tvmljs/player/1682117-shouldchangetomediaatindex.md)
- [shouldHandleStateChange](tvmljs/player/1627428-shouldhandlestatechange.md)
- [stateWillChange](tvmljs/player/1627331-statewillchange.md)
- [timeBoundaryDidCross](tvmljs/player/1627443-timeboundarydidcross.md)
- [timeDidChange](tvmljs/player/1627344-timedidchange.md)
- [timedMetadata](tvmljs/player/1627384-timedmetadata.md)
- [transportBarVisibilityDidChange](tvmljs/player/1682120-transportbarvisibilitydidchange.md)
