static checkVariantSupported_(variant, keySystem, keySystemsMapping) {
    const variantSupported = variant.decodingInfos.some((decodingInfo) => {
      if (!decodingInfo.supported) {
        return false;
      }
      if (keySystem) {
        const keySystemAccess = decodingInfo.keySystemAccess;
        if (keySystemAccess) {
          const currentKeySystem =
              keySystemsMapping[keySystemAccess.keySystem] ||
              keySystemAccess.keySystem;
          if (currentKeySystem != keySystem) {
            return false;
          }
        }
      }
      return true;
    });
    if (!variantSupported) {
      return false;
    }

    const device = shaka.device.DeviceFactory.getDevice();
    const isXboxOne = device.getDeviceName() === 'Xbox';
    const isFirefoxAndroid =
        device.getDeviceType() === shaka.device.IDevice.DeviceType.MOBILE &&
        device.getBrowserEngine() === shaka.device.IDevice.BrowserEngine.GECKO;

    // See: https://github.com/shaka-project/shaka-player/issues/3860
    const video = variant.video;
    const videoWidth = (video && video.width) || 0;
    const videoHeight = (video && video.height) || 0;

    // See: https://github.com/shaka-project/shaka-player/issues/3380
    // Note: it makes sense to drop early
    if (isXboxOne && video && (videoWidth > 1920 || videoHeight > 1080) &&
        (video.codecs.includes('avc1.') || video.codecs.includes('avc3.'))) {
      return false;
    }

    const videoDependencyStream = video && video.dependencyStream;
    if (videoDependencyStream &&
        !shaka.lcevc.Dec.isStreamSupported(videoDependencyStream)) {
      return false;
    }

    const audio = variant.audio;

    // See: https://github.com/shaka-project/shaka-player/issues/6111
    // It seems that Firefox Android reports that it supports
    // Opus + Widevine, but it is not actually supported.
    // It makes sense to drop early.
    if (isFirefoxAndroid && audio && audio.encrypted &&
        audio.codecs.toLowerCase().includes('opus')) {
      return false;
    }

    const audioDependencyStream = audio && audio.dependencyStream;
    if (audioDependencyStream) {
      return false;
    }

    return true;
  }
@param {!shaka.extern.Variant} variant
@param {?string} keySystem
@param {!Object<string, string>} keySystemsMapping
@return {boolean}
@private