<commit_before>/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


goog.provide('shaka.ui.Overlay');

goog.require('goog.asserts');
goog.require('shaka.polyfill.installAll');
goog.require('shaka.ui.Controls');
goog.require('shaka.ui.TextDisplayer');
goog.require('shaka.util.Platform');


/**
 * @param {!shaka.Player} player
 * @param {!HTMLElement} videoContainer
 * @param {!HTMLMediaElement} video
 * @implements {shaka.util.IDestroyable}
 * @constructor
 * @export
 */
shaka.ui.Overlay = function(player, videoContainer, video) {
  /** @private {shaka.Player} */
  this.player_ = player;

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

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

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

  // 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');
  }
};


/**
 * @override
 * @export
 */
shaka.ui.Overlay.prototype.destroy = async function() {
  await this.controls_.destroy();
  this.controls_ = null;

  await this.player_.destroy();
  this.player_ = null;
};


/**
 * Detects if this is a mobile platform, in case you want to choose a different<commit_msg>Fix API-based UI setup with default config<commit_after>/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


goog.provide('shaka.ui.Overlay');

goog.require('goog.asserts');
goog.require('shaka.polyfill.installAll');
goog.require('shaka.ui.Controls');
goog.require('shaka.ui.TextDisplayer');
goog.require('shaka.util.Platform');


/**
 * @param {!shaka.Player} player
 * @param {!HTMLElement} videoContainer
 * @param {!HTMLMediaElement} video
 * @implements {shaka.util.IDestroyable}
 * @constructor
 * @export
 */
shaka.ui.Overlay = function(player, videoContainer, video) {
  /** @private {shaka.Player} */
  this.player_ = player;

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

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

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

  // 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');
  }

  // Run the initial setup so that no configure() call is required for default
  // settings.
  this.configure({});
};


/**
 * @override
 * @export
 */
shaka.ui.Overlay.prototype.destroy = async function() {
  await this.controls_.destroy();
  this.controls_ = null;

  await this.player_.destroy();
  this.player_ = null;
};


/**
 * Detects if this is a mobile platform, in case you want to choose a different
{'fraction_non_alphanumeric': 0.13263358778625955, 'fraction_numerical': 0.003816793893129771, 'mean_word_length': 3.9445754716981134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6897642', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1223, 'n_words': 384}