static async checkDrmSupport_(videoConfig, audioConfig, mcapKeySystemConfig) {
    const MimeUtils = shaka.util.MimeUtils;
    const audioCapabilities = [];
    const videoCapabilities = [];

    if (mcapKeySystemConfig.audio) {
      const capability = {
        robustness: mcapKeySystemConfig.audio.robustness || '',
        contentType: audioConfig.contentType,
      };

      // Some Tizen devices seem to misreport AC-3 support, but correctly
      // report EC-3 support. So query EC-3 as a fallback for AC-3.
      // See https://github.com/shaka-project/shaka-player/issues/2989 for
      // details.
      if (shaka.device.DeviceFactory.getDevice().misreportAC3UsingDrm() &&
          audioConfig.contentType.includes('codecs="ac-3"')) {
        capability.contentType = 'audio/mp4; codecs="ec-3"';
      }

      if (mcapKeySystemConfig.audio.encryptionScheme) {
        capability.encryptionScheme =
            mcapKeySystemConfig.audio.encryptionScheme;
      }

      audioCapabilities.push(capability);
    }

    if (mcapKeySystemConfig.video) {
      const capability = {
        robustness: mcapKeySystemConfig.video.robustness || '',
        contentType: videoConfig.contentType,
      };
      if (mcapKeySystemConfig.video.encryptionScheme) {
        capability.encryptionScheme =
            mcapKeySystemConfig.video.encryptionScheme;
      }
      videoCapabilities.push(capability);
    }

    /** @type {MediaKeySystemConfiguration} */
    const mediaKeySystemConfig = {
      initDataTypes: [mcapKeySystemConfig.initDataType],
      distinctiveIdentifier: mcapKeySystemConfig.distinctiveIdentifier,
      persistentState: mcapKeySystemConfig.persistentState,
      sessionTypes: mcapKeySystemConfig.sessionTypes,
    };

    // Only add audio / video capabilities if they have valid data.
    // Otherwise the query will fail.
    if (audioCapabilities.length) {
      mediaKeySystemConfig.audioCapabilities = audioCapabilities;
    }
    if (videoCapabilities.length) {
      mediaKeySystemConfig.videoCapabilities = videoCapabilities;
    }

    const videoMimeType = videoConfig ? videoConfig.contentType : '';
    const audioMimeType = audioConfig ? audioConfig.contentType : '';
    const videoCodec = MimeUtils.getBasicType(videoMimeType) + ';' +
        MimeUtils.getCodecBase(videoMimeType);
    const audioCodec = MimeUtils.getBasicType(audioMimeType) + ';' +
        MimeUtils.getCodecBase(audioMimeType);
    const keySystem = mcapKeySystemConfig.keySystem;

    /** @type {MediaKeySystemAccess} */
    let keySystemAccess = null;
    try {
      if (shaka.drm.DrmUtils.hasMediaKeySystemAccess(
          videoCodec, audioCodec, keySystem)) {
        keySystemAccess = shaka.drm.DrmUtils.getMediaKeySystemAccess(
            videoCodec, audioCodec, keySystem);
      } else {
        keySystemAccess = await navigator.requestMediaKeySystemAccess(
            mcapKeySystemConfig.keySystem, [mediaKeySystemConfig]);
        shaka.drm.DrmUtils.setMediaKeySystemAccess(
            videoCodec, audioCodec, keySystem, keySystemAccess);
      }
    } catch (e) {
      shaka.log.info('navigator.requestMediaKeySystemAccess failed.');
    }

    return keySystemAccess;
  }
@param {VideoConfiguration} videoConfig The 'video' field of the
  MediaDecodingConfiguration.
@param {AudioConfiguration} audioConfig The 'audio' field of the
  MediaDecodingConfiguration.
@param {!MediaCapabilitiesKeySystemConfiguration} mcapKeySystemConfig The
  'keySystemConfiguration' field of the MediaDecodingConfiguration.
@return {Promise<MediaKeySystemAccess>}
@private