setLocalURL method

Future<void> setLocalURL(
  1. String path
)

Sets a local video file path as the player's source.

Throws ArgumentError when path is empty after trimming whitespace. Throws StateError when called before createPlayer completes.

Implementation

Future<void> setLocalURL(String path) async {
  final normalizedPath = path.trim();
  if (normalizedPath.isEmpty) {
    throw ArgumentError.value(path, 'path', 'Local video path is empty');
  }
  if (_playerIsCreated == false) {
    throw StateError(
        'setLocalURL: player not created, please await createPlayer first');
  }
  await engineInstanceMethodChannel.invokeMethod<void>(
      'setLocalURL', normalizedPath);
}