@polesye So no LD list. Then the above becomes:

var newQuality, value = this.videoQualityControl.quality,
      isHD = _.contains(this.config.availableHDQualities, value);

event.preventDefault();

// HD qualities are ordered from highest to lowest quality like
// the array that player.getAvailableQualityLevels() returns.
if (this.config.hasHDQualities) {
    newQuality = isHD ? 'large' : _.first(this.config.availableHDQualities);