checkRestrictedVariants(manifest) {
    const restrictedStatuses = shaka.media.ManifestFilterer.restrictedStatuses;
    const keyStatusMap =
        this.drmEngine_ ? this.drmEngine_.getKeyStatuses() : {};
    const keyIds = Object.keys(keyStatusMap);
    const isGlobalStatus = keyIds.length && keyIds[0] == '00';

    let hasPlayable = false;
    let hasAppRestrictions = false;

    /** @type {!Set<string>} */
    const missingKeys = new Set();

    /** @type {!Set<string>} */
    const badKeyStatuses = new Set();

    const streams = new Set();

    for (const variant of manifest.variants) {
      // TODO: Combine with onKeyStatus_.
      if (variant.audio) {
        streams.add(variant.audio);
      }
      if (variant.video) {
        streams.add(variant.video);
      }

      if (!variant.allowedByApplication) {
        hasAppRestrictions = true;
      } else if (variant.allowedByKeySystem) {
        hasPlayable = true;
      }
    }

    for (const stream of streams) {
      if (stream.keyIds.size) {
        for (const keyId of stream.keyIds) {
          const keyStatus = keyStatusMap[isGlobalStatus ? '00' : keyId];
          if (!keyStatus) {
            missingKeys.add(keyId);
          } else if (restrictedStatuses.includes(keyStatus)) {
            badKeyStatuses.add(keyStatus);
          }
        }
      }  // if (stream.keyIds.size)
    }

    if (!hasPlayable) {
      /** @type {shaka.extern.RestrictionInfo} */
      const data = {
        hasAppRestrictions,
        missingKeys: Array.from(missingKeys),
        restrictedKeyStatuses: Array.from(badKeyStatuses),
      };
      throw new shaka.util.Error(
          shaka.util.Error.Severity.CRITICAL,
          shaka.util.Error.Category.MANIFEST,
          shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET,
          data);
    }
  }
Checks if the variants are all restricted, and throw an appropriate
exception if so.

@param {shaka.extern.Manifest} manifest