parseClosedCaptions_(mediaTags) {
    const closedCaptionsTags =
        shaka.hls.Utils.filterTagsByType(mediaTags, 'CLOSED-CAPTIONS');
    this.needsClosedCaptionsDetection_ = closedCaptionsTags.length == 0;
    for (const tag of closedCaptionsTags) {
      goog.asserts.assert(tag.name == 'EXT-X-MEDIA',
          'Should only be called on media tags!');
      const languageValue = tag.getAttributeValue('LANGUAGE');
      let language = this.getLanguage_(languageValue);
      if (!languageValue) {
        const nameValue = tag.getAttributeValue('NAME');
        if (nameValue) {
          language = nameValue;
        }
      }

      // The GROUP-ID value is a quoted-string that specifies the group to which
      // the Rendition belongs.
      const groupId = tag.getRequiredAttrValue('GROUP-ID');

      // The value of INSTREAM-ID is a quoted-string that specifies a Rendition
      // within the segments in the Media Playlist. This attribute is REQUIRED
      // if the TYPE attribute is CLOSED-CAPTIONS.
      // We need replace SERVICE string by our internal svc string.
      const instreamId = tag.getRequiredAttrValue('INSTREAM-ID')
          .replace('SERVICE', 'svc');
      if (!this.groupIdToClosedCaptionsMap_.get(groupId)) {
        this.groupIdToClosedCaptionsMap_.set(groupId, new Map());
      }
      this.groupIdToClosedCaptionsMap_.get(groupId).set(instreamId, language);
    }
  }
Parses an array of EXT-X-MEDIA tags, then stores the values of all tags
with TYPE="CLOSED-CAPTIONS" into a map of group id to closed captions.

@param {!Array<!shaka.hls.Tag>} mediaTags
@private