isLoading static method

bool isLoading(
  1. VideoPlayerValue? value
)

Latest value can be null

Implementation

static bool isLoading(VideoPlayerValue? value) {
  if (value == null) {
    return true;
  }

  if (!value.isInitialized) {
    return true;
  }

  Duration? bufferedEndPosition;
  if (value.buffered.isNotEmpty == true) {
    bufferedEndPosition = value.buffered.last.end;
  }

  if (bufferedEndPosition != null) {
    if (value.isPlaying && value.isBuffering) {
      return true;
    }
  }
  return false;
}