computeCuePositionAlignment_(cue) {
    const Cue = shaka.text.Cue;
    const {direction, positionAlign, textAlign} = cue;

    if (positionAlign !== Cue.positionAlign.AUTO) {
      // Position align is not AUTO: use it
      return positionAlign;
    }

    // Position align is AUTO: use text align to compute its value

    if (textAlign === Cue.textAlign.LEFT ||
      (textAlign === Cue.textAlign.START &&
        direction === Cue.direction.HORIZONTAL_LEFT_TO_RIGHT) ||
      (textAlign === Cue.textAlign.END &&
        direction === Cue.direction.HORIZONTAL_RIGHT_TO_LEFT)) {
      return Cue.positionAlign.LEFT;
    }

    if (textAlign === Cue.textAlign.RIGHT ||
      (textAlign === Cue.textAlign.START &&
        direction === Cue.direction.HORIZONTAL_RIGHT_TO_LEFT) ||
      (textAlign === Cue.textAlign.END &&
        direction === Cue.direction.HORIZONTAL_LEFT_TO_RIGHT)) {
      return Cue.positionAlign.RIGHT;
    }

    return Cue.positionAlign.CENTER;
  }
Compute cue position alignment
See https://www.w3.org/TR/webvtt1/#webvtt-cue-position-alignment

@param {!shaka.text.Cue} cue
@private