retryDataSource method

Future retryDataSource()

Retry data source if playback failed.

Implementation

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