seekTo method

Future<void> seekTo (
  1. int msec
)

Implementation

Future<void> seekTo(int msec) async {
  await _nativeSetup.future;
  if (msec == null || msec < 0) {
    FijkLog.e("$this invoke seekTo invalid msec:$msec");
    return Future.error(
        ArgumentError.value(msec, "speed must be not null and >= 0"));
  } else if (!isPlayable()) {
    FijkLog.e("$this invoke seekTo invalid state:$state");
    return Future.error(StateError("Non playable state $state"));
  } else {
    FijkLog.i("$this invoke seekTo msec:$msec");
    _seeking = true;
    _channel.invokeMethod("seekTo", <String, dynamic>{"msec": msec});
  }
}