wang-bin / fvp

Flutter video player plugin for all desktop+mobile platforms. download prebuilt examples from github actions. https://pub.dev/packages/fvp
BSD 3-Clause "New" or "Revised" License
197 stars 31 forks source link

The 'callback' parameter of the Player's seek method is ineffective. #29

Closed vectorobject closed 1 year ago

vectorobject commented 1 year ago

It seems that the ‘callback’ parameter is not utilized in the source code.

bool seek(
      {required int position,
      SeekFlag flags = const SeekFlag(SeekFlag.defaultFlags),
      void Function(int)? callback}) {
    final cb = calloc<mdkSeekCallback>();
    //cb.ref.cb =
    // FIXME: seek flags seems not work
    final ret = _player.ref.seekWithFlags.asFunction<
            bool Function(Pointer<mdkPlayer>, int, int, mdkSeekCallback)>()(
        _player.ref.object, position, flags.rawValue, cb.ref);
    calloc.free(cb);
    return ret;
  }
wang-bin commented 1 year ago

yes, i will change those apis to async, then no callback is required