async getInterstitialsInfo_(hlsInterstitial) {
    const interstitialsAd = [];
    if (!hlsInterstitial) {
      return interstitialsAd;
    }
    const assetUri = hlsInterstitial.values.find((v) => v.key == 'X-ASSET-URI');
    const assetList =
        hlsInterstitial.values.find((v) => v.key == 'X-ASSET-LIST');
    if (!assetUri && !assetList) {
      return interstitialsAd;
    }
    let id = null;
    const hlsInterstitialId = hlsInterstitial.values.find((v) => v.key == 'ID');
    if (hlsInterstitialId) {
      id = /** @type {string} */(hlsInterstitialId.data);
    }
    const startTime = id == null ?
        Math.floor(hlsInterstitial.startTime * 10) / 10:
        hlsInterstitial.startTime;
    let endTime = hlsInterstitial.endTime;
    if (hlsInterstitial.endTime && hlsInterstitial.endTime != Infinity &&
        typeof(hlsInterstitial.endTime) == 'number') {
      endTime = id == null ?
          Math.floor(hlsInterstitial.endTime * 10) / 10:
          hlsInterstitial.endTime;
    }
    const restrict = hlsInterstitial.values.find((v) => v.key == 'X-RESTRICT');
    let isSkippable = true;
    let canJump = true;
    if (restrict && restrict.data) {
      const data = /** @type {string} */(restrict.data);
      isSkippable = !data.includes('SKIP');
      canJump = !data.includes('JUMP');
    }
    let skipOffset = isSkippable ? 0 : null;
    const enableSkipAfter =
        hlsInterstitial.values.find((v) => v.key == 'X-ENABLE-SKIP-AFTER');
    if (enableSkipAfter) {
      const enableSkipAfterString = /** @type {string} */(enableSkipAfter.data);
      skipOffset = parseFloat(enableSkipAfterString);
      if (isNaN(skipOffset)) {
        skipOffset = isSkippable ? 0 : null;
      }
    }
    let skipFor = null;
    const enableSkipFor =
        hlsInterstitial.values.find((v) => v.key == 'X-ENABLE-SKIP-FOR');
    if (enableSkipFor) {
      const enableSkipForString = /** @type {string} */(enableSkipFor.data);
      skipFor = parseFloat(enableSkipForString);
      if (isNaN(skipOffset)) {
        skipFor = null;
      }
    }
    let resumeOffset = null;
    const resume =
        hlsInterstitial.values.find((v) => v.key == 'X-RESUME-OFFSET');
    if (resume) {
      const resumeOffsetString = /** @type {string} */(resume.data);
      resumeOffset = parseFloat(resumeOffsetString);
      if (isNaN(resumeOffset)) {
        resumeOffset = null;
      }
    }
    let playoutLimit = null;
    const playout =
        hlsInterstitial.values.find((v) => v.key == 'X-PLAYOUT-LIMIT');
    if (playout) {
      const playoutLimitString = /** @type {string} */(playout.data);
      playoutLimit = parseFloat(playoutLimitString);
      if (isNaN(playoutLimit)) {
        playoutLimit = null;
      }
    }
    let once = false;
    let pre = false;
    let post = false;
    const cue = hlsInterstitial.values.find((v) => v.key == 'CUE');
    if (cue) {
      const data = /** @type {string} */(cue.data);
      once = data.includes('ONCE');
      pre = data.includes('PRE');
      post = data.includes('POST');
    }
    let timelineRange = false;
    const timelineOccupies =
        hlsInterstitial.values.find((v) => v.key == 'X-TIMELINE-OCCUPIES');
    if (timelineOccupies) {
      const data = /** @type {string} */(timelineOccupies.data);
      timelineRange = data.includes('RANGE');
    } else if (!resume && this.basePlayer_.isLive()) {
      timelineRange = !pre && !post;
    }
    if (assetUri) {
      const uri = /** @type {string} */(assetUri.data);
      if (!uri) {
        return interstitialsAd;
      }
      interstitialsAd.push({
        id,
        groupId: null,
        startTime,
        endTime,
        uri,
        mimeType: null,
        isSkippable,
        skipOffset,
        skipFor,
        canJump,
        resumeOffset,
        playoutLimit,
        once,
        pre,
        post,
        timelineRange,
        loop: false,
        overlay: null,
        displayOnBackground: false,
        currentVideo: null,
        background: null,
      });
    } else if (assetList) {
      const uri = /** @type {string} */(assetList.data);
      if (!uri) {
        return interstitialsAd;
      }
      try {
        const NetworkingEngine = shaka.net.NetworkingEngine;
        const context = {
          type: NetworkingEngine.AdvancedRequestType.INTERSTITIAL_ASSET_LIST,
        };
        const responseData = await this.makeAdRequest_(uri, context);
        const data = shaka.util.StringUtils.fromUTF8(responseData);
        const dataAsJson =
        /** @type {!shaka.ads.InterstitialAdManager.AssetsList} */ (
            JSON.parse(data));
        const skipControl = dataAsJson['SKIP-CONTROL'];
        if (skipControl) {
          const enableSkipAfterValue = skipControl['ENABLE-SKIP-AFTER'];
          if ((typeof enableSkipAfterValue) == 'number') {
            skipOffset = parseFloat(enableSkipAfterValue);
            if (isNaN(enableSkipAfterValue)) {
              skipOffset = isSkippable ? 0 : null;
            }
          }
          const enableSkipForValue = skipControl['ENABLE-SKIP-FOR'];
          if ((typeof enableSkipForValue) == 'number') {
            skipFor = parseFloat(enableSkipForValue);
            if (isNaN(enableSkipForValue)) {
              skipFor = null;
            }
          }
        }
        for (let i = 0; i < dataAsJson['ASSETS'].length; i++) {
          const asset = dataAsJson['ASSETS'][i];
          if (asset['URI']) {
            interstitialsAd.push({
              id: id + '_shaka_asset_' + i,
              groupId: id,
              startTime,
              endTime,
              uri: asset['URI'],
              mimeType: null,
              isSkippable,
              skipOffset,
              skipFor,
              canJump,
              resumeOffset,
              playoutLimit,
              once,
              pre,
              post,
              timelineRange,
              loop: false,
              overlay: null,
              displayOnBackground: false,
              currentVideo: null,
              background: null,
            });
          }
        }
      } catch (e) {
        // Ignore errors
      }
    }
    return interstitialsAd;
  }
@param {shaka.extern.HLSInterstitial} hlsInterstitial
@return {!Promise<!Array<shaka.extern.AdInterstitial>>}
@private