> For the complete documentation index, see [llms.txt](https://canardoux.gitbook.io/tau/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://canardoux.gitbook.io/tau/doc/pages/tau-api/player/get_player_state.md).

# The τ Player API

getPlayerState()

## `playerState`, `isPlaying`, `isPaused`, `isStopped`. `getPlayerState()`

* Dart API: [getPlayerState()](https://github.com/Canardoux/tau/tree/6bd245d293bcf9a123677735835549585d32b2ee/doc/pages/tau-api/player/pages/flutter-sound/api/player/FlutterSoundPlayer/getPlayerState.html).
* Dart API: [isPlaying](https://github.com/Canardoux/tau/tree/6bd245d293bcf9a123677735835549585d32b2ee/doc/pages/tau-api/player/pages/flutter-sound/api/player/FlutterSoundPlayer/isPlaying.html).
* Dart API: [isPaused](https://github.com/Canardoux/tau/tree/6bd245d293bcf9a123677735835549585d32b2ee/doc/pages/tau-api/player/pages/flutter-sound/api/player/FlutterSoundPlayer/isPaused.html).
* Dart API: [isStopped](https://github.com/Canardoux/tau/tree/6bd245d293bcf9a123677735835549585d32b2ee/doc/pages/tau-api/player/pages/flutter-sound/api/player/FlutterSoundPlayer/isStopped.html).
* Dart API: [playerState](https://github.com/Canardoux/tau/tree/6bd245d293bcf9a123677735835549585d32b2ee/doc/pages/tau-api/player/pages/flutter-sound/api/player/FlutterSoundPlayer/playerState.html).

This four verbs is used when the app wants to get the current Audio State of the player.

`playerState` is an attribut which can have the following values :

* isStopped   /// Player is stopped
* isPlaying   /// Player is playing
* isPaused    /// Player is paused
* isPlaying is a boolean attribut which is `true` when the player is in the "Playing" mode.
* isPaused is a boolean atrribut which  is `true` when the player is in the "Paused" mode.
* isStopped is a boolean atrribut which  is `true` when the player is in the "Stopped" mode.

Flutter Sound shows in the `playerState` attribut the last known state. When the Audio State of the background OS engine changes, the `playerState` parameter is not updated exactly at the same time. If you want the exact background OS engine state you must use `PlayerState theState = await myPlayer.getPlayerState()`. Acutually `getPlayerState()` is only implemented on iOS.

*Example:*

[Dart](/tau/doc/pages/tau-api/player/get_player_state.md#dart)

[Javascript](/tau/doc/pages/tau-api/player/get_player_state.md#javascript)

```

        swtich(myPlayer.playerState)
        {
                case PlayerState.isPlaying: doSomething; break;
                case PlayerState.isStopped: doSomething; break;
                case PlayerState.isPaused: doSomething; break;
        }
        ...
        if (myPlayer.isStopped) doSomething;
        if (myPlayer.isPlaying) doSomething;
        if (myPlayer.isPaused) doSomething;
        ...
        PlayerState theState = await myPlayer.getPlayerState();
        ...
```

```

        Lorem ipsum ...
```

\</div>
