code: function getPlayClipTimeouts(vector, speed) {
    let i;
    let sample;
    let delay;
    let sum = 0;
    const limit = vector.length;
    const timeouts = [];
  
    // Initialize time varying to false
    timeouts.isTimeVarying = false;
  
    if (typeof speed !== 'number' || speed <= 0) {
      speed = 1;
    }
  
    // First element of a frame time vector must be discarded
    for (i = 1; i < limit; i++) {
      // eslint-disable-next-line no-bitwise
      delay = (Number(vector[i]) / speed) | 0; // Integral part only
      timeouts.push(delay);
      if (i === 1) {
        // Use first item as a sample for comparison
        sample = delay;
      } else if (delay !== sample) {
        timeouts.isTimeVarying = true;
      }
  
      sum += delay;
    }
  
    if (timeouts.length > 0) {
      if (timeouts.isTimeVarying) {
        // If it's a time varying vector, make the last item an average...
        // eslint-disable-next-line no-bitwise
        delay = (sum / timeouts.length) | 0;
      } else {
        delay = timeouts[0];
      }
  
      timeouts.push(delay);
    }
  
    return timeouts;
  }
docs: [private] Turns a Frame Time Vector (0018,1065) array into a normalized array of timeouts. Each element
  ... of the resulting array represents the amount of time each frame will remain on the screen.
  @param {Array} vector A Frame Time Vector (0018,1065) as specified in section C.7.6.5.1.2 of DICOM standard.
  @param {Number} speed A speed factor which will be applied to each element of the resulting array.
  @returns {Array} An array with timeouts for each animation frame.