Skip to main content Link Menu Expand (external link) Document Search Copy Copied
setSubscriptionDuration method - FlutterSoundPlayer class - player library - Dart API
menu
setSubscriptionDuration

setSubscriptionDuration method

Future<void> setSubscriptionDuration(
  1. Duration duration
)

Specify the callbacks frequency of the onProgress stream.


The default value is 0 (zero) which means that there is no callbacks. If you really want to receive the events, do not forget to call this verb.

Example

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

See also


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 ');
}
flutter_sound 9.25.3