getResolutionLabel_(track, tracks) {
    let trackHeight = track.height || 0;
    let trackWidth = track.width || 0;
    if (trackHeight > trackWidth) {
      // Vertical video.
      [trackWidth, trackHeight] = [trackHeight, trackWidth];
    }
    let height = trackHeight;
    const aspectRatio = trackWidth / trackHeight;
    if (aspectRatio > (16 / 9)) {
      height = Math.round(trackWidth * 9 / 16);
    }
    let text = height + 'p';
    const frameRates = new Set();
    for (const item of tracks) {
      if (item.frameRate) {
        frameRates.add(Math.round(item.frameRate));
      }
    }
    if (frameRates.size > 1) {
      const frameRate = track.frameRate;
      if (frameRate && (frameRate >= 50 || frameRate <= 20)) {
        text += Math.round(track.frameRate);
      }
    }
    if (track.hdr == 'PQ' || track.hdr == 'HLG') {
      text += ' HDR';
    }
    const videoLayout = track.videoLayout || '';
    if (videoLayout.includes('CH-STEREO')) {
      text += ' 3D';
    }
    const basicResolutionComparison = (firstTrack, secondTrack) => {
      return firstTrack != secondTrack &&
          firstTrack.height == secondTrack.height &&
          firstTrack.hdr == secondTrack.hdr &&
          Math.round(firstTrack.frameRate || 0) ==
          Math.round(secondTrack.frameRate || 0);
    };
    const hasDuplicateResolution = tracks.some((otherTrack) => {
      return basicResolutionComparison(track, otherTrack);
    });
    if (hasDuplicateResolution) {
      const hasDuplicateBandwidth = tracks.some((otherTrack) => {
        return basicResolutionComparison(track, otherTrack) &&
            otherTrack.bandwidth == track.bandwidth;
      });
      if (!hasDuplicateBandwidth) {
        const bandwidth = track.bandwidth;
        text += ' (' + Math.round(bandwidth / 1000) + ' kbits/s)';
      }

      if (this.controls.getConfig().showVideoCodec) {
        const getVideoCodecName = (codecs) => {
          let name = '';
          if (codecs) {
            const codec = shaka.util.MimeUtils.getNormalizedCodec(codecs);
            if (codec.startsWith('dovi-')) {
              name = 'Dolby Vision';
            } else {
              name = codec.toUpperCase();
            }
          }
          return name ? ' ' + name : name;
        };
        const hasDuplicateCodec = tracks.some((otherTrack) => {
          return basicResolutionComparison(track, otherTrack) &&
              getVideoCodecName(otherTrack.codecs) !=
              getVideoCodecName(track.codecs);
        });
        if (hasDuplicateCodec) {
          text += getVideoCodecName(track.codecs);
        }
      }
    }
    return text;
  }
@param {!shaka.extern.VideoTrack} track
@param {!Array<!shaka.extern.VideoTrack>} tracks
@return {string}
@private