findApi static method

bool findApi({
  1. ScormVersion? version,
  2. int maxTries = 7,
})

Tries to find SCORM API in the hierarchy up-to maxTries level. If it's not found in the current hierarchy, it tries to find it in the opener's hierarchy

If a version is specified, then will search only for that specific version, else will try to find both versions (preference is given to v2004)

Returns whether the SCORM API has been found. The API status can also be accessed at any point of time with apiFound

Implementation

static bool findApi({ScormVersion? version, int maxTries = 7}) {
  if (version == null) {
    _version = ScormVersion.v2004;
    if (_findVersion(maxTries: maxTries)) {
      return true;
    } else {
      _version = ScormVersion.v1_2;
      return _findVersion(maxTries: maxTries);
    }
  } else {
    _version = version;
    return _findVersion(maxTries: _maxTries);
  }
}