async parseDrmInfo_(playlist, mimeType, getUris, variables) {
    /** @type {!Map<!shaka.hls.Tag, ?shaka.media.InitSegmentReference>} */
    const drmTagsMap = new Map();
    if (!this.config_.ignoreDrmInfo && playlist.segments) {
      for (const segment of playlist.segments) {
        const segmentKeyTags = shaka.hls.Utils.filterTagsByName(segment.tags,
            'EXT-X-KEY');
        let initSegmentRef = null;
        if (segmentKeyTags.length) {
          initSegmentRef = this.getInitSegmentReference_(playlist,
              segment.tags, getUris, variables);
          for (const segmentKeyTag of segmentKeyTags) {
            drmTagsMap.set(segmentKeyTag, initSegmentRef);
          }
        }
      }
    }

    let encrypted = false;
    let aesEncrypted = false;

    /** @type {!Array<shaka.extern.DrmInfo>}*/
    const drmInfos = [];
    const keyIds = new Set();

    for (const [key, value] of drmTagsMap) {
      const drmTag = /** @type {!shaka.hls.Tag} */ (key);
      const initSegmentRef =
      /** @type {?shaka.media.InitSegmentReference} */ (value);
      const method = drmTag.getRequiredAttrValue('METHOD');
      if (method != 'NONE') {
        encrypted = true;

        // According to the HLS spec, KEYFORMAT is optional and implicitly
        // defaults to "identity".
        // https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-11#section-4.4.4.4
        const keyFormat =
            drmTag.getAttributeValue('KEYFORMAT') || 'identity';
        let drmInfo = null;

        if (this.isAesMethod_(method)) {
          // These keys are handled separately.
          aesEncrypted = true;
          continue;
        } else if (keyFormat == 'identity') {
          // eslint-disable-next-line no-await-in-loop
          drmInfo = await this.identityDrmParser_(
              drmTag, mimeType, getUris, initSegmentRef, variables);
        } else {
          const drmParser =
              this.keyFormatsToDrmParsers_.get(keyFormat);
          drmInfo = drmParser ?
            // eslint-disable-next-line no-await-in-loop
            await drmParser(drmTag, mimeType, initSegmentRef) :
            null;
        }
        if (drmInfo) {
          if (drmInfo.keyIds) {
            for (const keyId of drmInfo.keyIds) {
              keyIds.add(keyId);
            }
          }
          drmInfos.push(drmInfo);
        } else {
          shaka.log.warning('Unsupported HLS KEYFORMAT', keyFormat);
        }
      }
    }

    return {drmInfos, keyIds, encrypted, aesEncrypted};
  }
@param {!shaka.hls.Playlist} playlist
@param {string} mimeType
@param {function(): !Array<string>} getUris
@param {?Map<string, string>=} variables
@return {Promise<{
  drmInfos: !Array<shaka.extern.DrmInfo>,
  keyIds: !Set<string>,
  encrypted: boolean,
  aesEncrypted: boolean
}>}
@private