updateClock method

void updateClock()

Implementation

void updateClock(){
  Log(tag).i("updateClock: $_currentSeconds");
  if(mounted) {
    if (_currentSeconds == 30) {
      refresh();
    }else {
      if (visiblePercentage >= 50) {
        totalViewTime += 1;
        savedViewPercentage = visiblePercentage;
        if (!oneSecMrcSent) {
          sendViewTime("mrc");
          oneSecMrcSent = true;
        }
      } else {
        sendViewTime("mrc");
      }
      _currentSeconds++;
    }
    // for standard: custom
    if (adResponse?.getStandard() == "custom") {
      int? minVT = adResponse?.minViewTime;
      int? minVP = adResponse?.minViewPercentage;
      if (totalViewTime == minVT && visiblePercentage >= minVP!) {
        sendViewTime("custom");
      }
    }
  }
}