---
title: stateWillChange
framework: tvmljs
role: symbol
role_heading: Instance Property
path: tvmljs/player/1627331-statewillchange
---

# stateWillChange

An event that indicates the state of the player is about to change.

## Declaration

```data
attribute  stateWillChange;
```

## Discussion

Discussion The listener is passed an event object with the following attributes: 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)
- [stateDidChange](tvmljs/player/1627390-statedidchange.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)
