constructor(root, candidates, compareCodecs = true) {
    /** @private {shaka.extern.Variant} */
    this.root_ = root;
    /** @private {!Set<shaka.extern.Variant>} */
    this.variants_ = new Set([root]);

    // Try to add all the candidates. If they cannot be added (because they
    // are not compatible with the root, they will be rejected by |add|.
    candidates = candidates || [];
    for (const candidate of candidates) {
      this.add(candidate, compareCodecs);
    }
  }
@param {shaka.extern.Variant} root
   The variant that all other variants will be tested against when being
   added to the adaptation set. If a variant is not compatible with the
   root, it will not be added.
@param {!Iterable<shaka.extern.Variant>=} candidates
   Variants that may be compatible with the root and should be added if
   compatible. If a candidate is not compatible, it will not end up in the
   adaptation set.
@param {boolean=} compareCodecs