setSubscriptionDuration method

Future<void> setSubscriptionDuration(
  1. Duration duration
)

Specify the callbacks frenquency, before calling startPlayer.

The default value is 0 (zero) which means that there is no callbacks.

This verb will be Deprecated soon.

Example:

myPlayer.setSubscriptionDuration(Duration(milliseconds: 100));

Implementation

Future<void> setSubscriptionDuration(Duration duration) async {
  _logger.d('FS:---> setSubscriptionDuration ');
  await _waitOpen();
  if (_isInited != Initialized.fullyInitialized) {
    throw Exception('Player is not open');
  }
  var state = await FlutterSoundPlayerPlatform.instance
      .setSubscriptionDuration(this, duration: duration);
  _playerState = PlayerState.values[state];
  _logger.d('FS:<---- setSubscriptionDuration ');
}