toggleVideoFit method

void toggleVideoFit()

Toggle Change the videofit accordingly

Implementation

void toggleVideoFit() {
  videoFitChangedTimer?.cancel();
  videoFitChanged.value = true;
  if (fits.indexOf(_videoFit.value) < fits.length - 1) {
    _videoFit.value = fits[fits.indexOf(_videoFit.value) + 1];
  } else {
    _videoFit.value = fits[0];
  }
  customDebugPrint(_videoFit.value);
  videoFitChangedTimer = Timer(const Duration(seconds: 1), () {
    customDebugPrint("hidden videoFit Changed");
    //videoFitChangedTimer = null;
    videoFitChanged.value = false;
    setUserPreferenceForFit();
  });
}