static install(enableUninstall = false) {
    // Alias
    const PatchedMediaKeysApple = shaka.polyfill.PatchedMediaKeysApple;

    if (!window.HTMLVideoElement || !window.WebKitMediaKeys) {
      // No HTML5 video or no prefixed EME.
      return;
    }

    if (window.shakaMediaKeysPolyfill == PatchedMediaKeysApple.apiName_) {
      // Already installed.
      return;
    }

    if (enableUninstall) {
      PatchedMediaKeysApple.enableUninstall = true;
      PatchedMediaKeysApple.originalHTMLMediaElementPrototypeMediaKeys =
        /** @type {!Object} */ (
          Object.getOwnPropertyDescriptor(
              // eslint-disable-next-line no-restricted-syntax
              HTMLMediaElement.prototype, 'mediaKeys',
          )
        );
      PatchedMediaKeysApple.originalHTMLMediaElementPrototypeSetMediaKeys =
          // eslint-disable-next-line no-restricted-syntax
          HTMLMediaElement.prototype.setMediaKeys;
      PatchedMediaKeysApple.originalWindowMediaKeys = window.MediaKeys;
      PatchedMediaKeysApple.originalWindowMediaKeySystemAccess =
          window.MediaKeySystemAccess;
      PatchedMediaKeysApple.originalNavigatorRequestMediaKeySystemAccess =
          navigator.requestMediaKeySystemAccess;
    }

    shaka.log.info('Using Apple-prefixed EME');

    // Delete mediaKeys to work around strict mode compatibility issues.
    // eslint-disable-next-line no-restricted-syntax
    delete HTMLMediaElement.prototype['mediaKeys'];
    // Work around read-only declaration for mediaKeys by using a string.
    // eslint-disable-next-line no-restricted-syntax
    HTMLMediaElement.prototype['mediaKeys'] = null;
    // eslint-disable-next-line no-restricted-syntax
    HTMLMediaElement.prototype.setMediaKeys =
        PatchedMediaKeysApple.setMediaKeys;

    // Install patches
    window.MediaKeys = PatchedMediaKeysApple.MediaKeys;
    window.MediaKeySystemAccess = PatchedMediaKeysApple.MediaKeySystemAccess;
    navigator.requestMediaKeySystemAccess =
        PatchedMediaKeysApple.requestMediaKeySystemAccess;

    window.shakaMediaKeysPolyfill = PatchedMediaKeysApple.apiName_;

    shaka.util.StreamUtils.clearDecodingConfigCache();
    shaka.drm.DrmUtils.clearMediaKeySystemAccessMap();
  }
Installs the polyfill if needed.
@param {boolean=} enableUninstall enables uninstalling the polyfill
@export