getPlayerState method

Future<PlayerState> getPlayerState()

Query the current state to the Tau 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 the background state.

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;
}