seekTo method

Future<String> seekTo(
  1. Duration position
)

position Move location millisecond timestamp.

⚠️ You must after AudioManagerEvents.ready event invoked before you can change the playback progress

Implementation

Future<String> seekTo(Duration position) async {
  if (_preprocessing().isNotEmpty) return _preprocessing();
  if (position.inMilliseconds < 0 ||
      position.inMilliseconds > duration.inMilliseconds)
    return "[position] must be greater than 0 and less than the total duration";
  return await _channel
      .invokeMethod("seekTo", {"position": position.inMilliseconds});
}