getNextMediaSequenceAndPart_(mediaSequenceNumber, segments) {
    const currentMediaSequence = mediaSequenceNumber + segments.length - 1;
    let nextMediaSequence = currentMediaSequence;
    let nextPart = -1;
    if (!segments.length) {
      nextMediaSequence++;
      return {
        nextMediaSequence,
        nextPart,
      };
    }
    const lastSegment = segments[segments.length - 1];
    const partialReferences = lastSegment.partialReferences;
    if (!lastSegment.partialReferences.length) {
      nextMediaSequence++;
      if (lastSegment.hasByterangeOptimization()) {
        nextPart = 0;
      }
      return {
        nextMediaSequence,
        nextPart,
      };
    }
    nextPart = partialReferences.length - 1;
    const lastPartialReference =
        partialReferences[partialReferences.length - 1];
    if (!lastPartialReference.isPreload()) {
      nextMediaSequence++;
      nextPart = 0;
    }
    return {
      nextMediaSequence,
      nextPart,
    };
  }
Get the next msn and part

@param {number} mediaSequenceNumber
@param {!Array<!shaka.media.SegmentReference>} segments
@return {{nextMediaSequence: number, nextPart:number}}}
@private