set quality(input) {
    const config = this.config.quality;
    const options = this.options.quality;

    if (!options.length) {
      return;
    }

    let quality = [
      !is.empty(input) && Number(input),
      this.storage.get('quality'),
      config.selected,
      config.default,
    ].find(is.number);

    let updateStorage = true;

    if (!options.includes(quality)) {
      const value = closest(options, quality);
      this.debug.warn(`Unsupported quality option: ${quality}, using ${value} instead`);
      quality = value;

      // Don't update storage if quality is not supported
      updateStorage = false;
    }

    // Update config
    config.selected = quality;

    // Set quality
    this.media.quality = quality;

    // Save to storage
    if (updateStorage) {
      this.storage.set({ quality });
    }
  }
Set playback quality
Currently HTML5 & YouTube only
@param {Number} input - Quality level