initialize method

Future<void> initialize()

Configure the native session and load the file. Resolves once the codec is ready and value.size / value.duration are populated. Throws if the file is missing, unreadable, or unsupported.

Implementation

Future<void> initialize() {
  _throwIfDisposed('initialize');
  final existing = _initCompleter;
  if (existing != null) return existing.future;
  final completer = Completer<void>();
  _initCompleter = completer;
  _initInternal().then(
    (_) => completer.complete(),
    onError: completer.completeError,
  );
  return completer.future;
}