constructor(adContainer, video, locale, adsRenderingSettings, onEvent) {
    /** @private {HTMLElement} */
    this.adContainer_ = adContainer;

    /** @private {HTMLMediaElement} */
    this.video_ = video;

    /** @private {boolean} */
    this.videoPlayed_ = false;

    /** @private {?shaka.extern.AdsConfiguration} */
    this.config_ = null;

    /** @private {ResizeObserver} */
    this.resizeObserver_ = null;

    /** @private {number} */
    this.requestAdsStartTime_ = NaN;

    /** @private {function(!shaka.util.FakeEvent)} */
    this.onEvent_ = onEvent;

    /** @private {shaka.ads.ClientSideAd} */
    this.ad_ = null;

    /** @private {shaka.util.EventManager} */
    this.eventManager_ = new shaka.util.EventManager();

    google.ima.settings.setLocale(locale);

    google.ima.settings.setDisableCustomPlaybackForIOS10Plus(true);

    /** @private {!google.ima.AdDisplayContainer} */
    this.adDisplayContainer_ = new google.ima.AdDisplayContainer(
        this.adContainer_,
        this.video_);

    // TODO: IMA: Must be done as the result of a user action on mobile
    this.adDisplayContainer_.initialize();

    // IMA: This instance should be re-used for the entire lifecycle of
    // the page.
    this.adsLoader_ = new google.ima.AdsLoader(this.adDisplayContainer_);

    this.adsLoader_.getSettings().setPlayerType('shaka-player');
    this.adsLoader_.getSettings().setPlayerVersion(shaka.Player.version);

    /** @private {google.ima.AdsManager} */
    this.imaAdsManager_ = null;

    /** @private {!google.ima.AdsRenderingSettings} */
    this.adsRenderingSettings_ =
        adsRenderingSettings || new google.ima.AdsRenderingSettings();

    this.eventManager_.listen(this.adsLoader_,
        google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, (e) => {
          this.onAdsManagerLoaded_(
              /** @type {!google.ima.AdsManagerLoadedEvent} */ (e));
        });

    this.eventManager_.listen(this.adsLoader_,
        google.ima.AdErrorEvent.Type.AD_ERROR, (e) => {
          this.onAdError_( /** @type {!google.ima.AdErrorEvent} */ (e));
        });

    // Notify the SDK when the video has ended, so it can play post-roll ads.
    this.eventManager_.listen(this.video_, 'ended', () => {
      this.adsLoader_.contentComplete();
    });

    this.eventManager_.listenOnce(this.video_, 'play', () => {
      this.videoPlayed_ = true;
    });
  }
@param {HTMLElement} adContainer
@param {HTMLMediaElement} video
@param {string} locale
@param {?google.ima.AdsRenderingSettings} adsRenderingSettings
@param {function(!shaka.util.FakeEvent)} onEvent