retryDataSource method

Future retryDataSource()

Retry data source if playback failed.

Implementation

Future retryDataSource() async {
  await _setupDataSource(_pipFlutterPlayerDataSource!);
  if (_videoPlayerValueOnError != null) {
    final position = _videoPlayerValueOnError!.position;
    await seekTo(position);
    await play();
    _videoPlayerValueOnError = null;
  }
}