static filterVariantsByRole_(variants, preferredRole) {
    return variants.filter((variant) => {
      if (!variant.audio) {
        return false;
      }

      if (preferredRole) {
        return variant.audio.roles.includes(preferredRole);
      } else {
        return variant.audio.roles.length == 0;
      }
    });
  }
Filter Variants by role.

@param {!Array<shaka.extern.Variant>} variants
@param {string} preferredRole
@return {!Array<shaka.extern.Variant>}
@private