constructor(player, videoContainer, video, vrCanvas = null) {
    /** @private {shaka.Player} */
    this.player_ = player;

    /** @private {HTMLElement} */
    this.videoContainer_ = videoContainer;

    /** @private {!shaka.extern.UIConfiguration} */
    this.config_ = this.defaultConfig_();

    // Get and configure cast app id.
    let castAppId = '';

    // Get and configure cast Android Receiver Compatibility
    let castAndroidReceiverCompatible = false;

    // Cast receiver id can be specified on either container or video.
    // It should not be provided on both. If it was, we will use the last
    // one we saw.
    if (videoContainer['dataset'] &&
        videoContainer['dataset']['shakaPlayerCastReceiverId']) {
      const dataSet = videoContainer['dataset'];
      castAppId = dataSet['shakaPlayerCastReceiverId'];
      castAndroidReceiverCompatible =
          dataSet['shakaPlayerCastAndroidReceiverCompatible'] === 'true';
    } else if (video['dataset'] &&
               video['dataset']['shakaPlayerCastReceiverId']) {
      const dataSet = video['dataset'];
      castAppId = dataSet['shakaPlayerCastReceiverId'];
      castAndroidReceiverCompatible =
          dataSet['shakaPlayerCastAndroidReceiverCompatible'] === 'true';
    }

    if (castAppId.length) {
      this.config_.castReceiverAppId = castAppId;
      this.config_.castAndroidReceiverCompatible =
          castAndroidReceiverCompatible;
    }

    // Make sure this container is discoverable and that the UI can be reached
    // through it.
    videoContainer['dataset']['shakaPlayerContainer'] = '';
    videoContainer['ui'] = this;

    // Tag the container for mobile platforms, to allow different styles.
    if (this.isMobile()) {
      videoContainer.classList.add('shaka-mobile');
    }

    /** @private {shaka.ui.Controls} */
    this.controls_ = new shaka.ui.Controls(
        player, videoContainer, video, vrCanvas, this.config_);

    // If the browser's native controls are disabled, use UI TextDisplayer.
    if (!video.controls) {
      player.setVideoContainer(videoContainer);
    }

    videoContainer['ui'] = this;
    video['ui'] = this;
    /** @private {shaka.ui.Watermark} */
    this.watermark_ = null;
  }
@param {!shaka.Player} player
@param {!HTMLElement} videoContainer
@param {!HTMLMediaElement} video
@param {?HTMLCanvasElement=} vrCanvas