# getPlayerState method

Future<PlayerState> getPlayerState()

Query the current state of the Flutter Sound Core layer.

Most of the time, the App will not use this verb, but will use the playerState variable. This is seldom used when the App wants to get an updated value of the background state.

## See also

- playerState

## Implementation

    Future<PlayerState> getPlayerState() async {
      await _waitOpen();
      if (_isInited != Initialized.fullyInitialized) {
        throw Exception('Player is not open');
      }
      var state = await FlutterSoundPlayerPlatform.instance.getPlayerState(this);
      _playerState = PlayerState.values[state];
      return _playerState;
    }