addMetadataToRegionTimeline_(startTime, endTime, metadataType, payload) {
    if (!this.metadataRegionTimeline_) {
      return;
    }
    goog.asserts.assert(!endTime || startTime <= endTime,
        'Metadata start time should be less or equal to the end time!');
    /** @type {shaka.extern.MetadataTimelineRegionInfo} */
    const region = {
      schemeIdUri: metadataType,
      startTime,
      endTime: endTime || Infinity,
      id: '',
      payload,
    };
    // JSON stringify produces a good ID in this case.
    region.id = JSON.stringify(region);
    this.metadataRegionTimeline_.addRegion(region);
  }
Add metadata to region timeline

@param {number} startTime
@param {?number} endTime
@param {string} metadataType
@param {shaka.extern.MetadataFrame} payload
@private