updatePlaybackRateSelection_() {
    const rate = this.player.getPlaybackRate();
    // Remove the old checkmark icon and related tags and classes if it exists.
    const checkmarkIcon = shaka.ui.Utils.getDescendantIfExists(
        this.menu, 'material-icons-round shaka-chosen-item');
    if (checkmarkIcon) {
      const previouslySelectedButton = checkmarkIcon.parentElement;
      previouslySelectedButton.removeAttribute('aria-selected');
      const previouslySelectedSpan =
          previouslySelectedButton.getElementsByTagName('span')[0];
      previouslySelectedSpan.classList.remove('shaka-chosen-item');
      previouslySelectedButton.removeChild(checkmarkIcon);
    }
    // Find the button that represents the newly selected playback rate.
    // Add the checkmark icon, related tags and classes to the newly selected
    // button.
    const span = Array.from(this.menu.querySelectorAll('span')).find((el) => {
      return el.textContent == (rate + 'x');
    });
    if (span) {
      const button = span.parentElement;
      button.appendChild(shaka.ui.Utils.checkmarkIcon());
      button.ariaSelected = 'true';
      span.classList.add('shaka-chosen-item');
    }

    // Set the label to display the current playback rate in the overflow menu,
    // in the format of '1x', '1.5x', etc.
    this.currentSelection.textContent = rate + 'x';
    this.button.setAttribute('shaka-status', rate + 'x');
    if (this.playbackRateMark) {
      this.playbackRateMark.textContent = rate + 'x';
    }
  }
Update checkmark icon and related class and attribute for the chosen rate
button.
@private