/**
 * @file play-progress-bar.js
 */
'../../component.js'에서 컴포넌트 가져오기;
'../../utils/browser.js'에서 {IS_IOS, IS_ANDROID} 가져오기;
import * as Fn from '../../utils/fn.js';

import './time-tooltip';

/**
 * {@link SeekBar}에서 미디어 재생 진행률을 표시하는 데 사용됩니다.
 * {@link ProgressControl}.
 *
 * @extends 컴포넌트
 */
클래스 PlayProgressBar 확장 구성 요소 {

  /**
   * 이 클래스의 인스턴스를 만듭니다.
   *
   * @param {플레이어} 플레이어
   * 이 클래스가 연결되어야 하는 {@link Player}입니다.
   *
   * @param {객체} [옵션]
   * 플레이어 옵션의 키/값 저장소.
   */
  생성자(플레이어, 옵션) {
    super(플레이어, 옵션);
    this.update = Fn.throttle(Fn.bind(this, this.update), Fn.UPDATE_REFRESH_INTERVAL);
  }

  /**
   * 이 클래스에 대한 DOM 요소를 만듭니다.
   *
   * @return {요소}
   * 생성된 요소입니다.
   */
  createEl() {
    return super.createEl('div', {
      className: 'vjs-play-progress vjs-슬라이더-바'
    }, {
      'aria-hidden': '참'
    });
  }

  /**
   * 자신의 DOM뿐만 아니라 자신의 DOM에 대한 업데이트를 큐에 넣습니다.
   * {@link TimeTooltip} 자식.
   *
   * @param {객체} seekBarRect
   * {@link SeekBar} 요소에 대한 `ClientRect`.
   *
   * @param {숫자} seekBarPoint
   * 수평 기준점을 나타내는 0에서 1 사이의 숫자
   * {@link SeekBar}의 왼쪽 가장자리에서
   */
  업데이트(seekBarRect, seekBarPoint) {
    const timeTooltip = this.getChild('timeTooltip');

    if (!timeTooltip) {
      반품;
    }

    const 시간 = (this.player_.scrubbing()) ?
      this.player_.getCache().currentTime :
      this.player_.currentTime();

    timeTooltip.updateTime(seekBarRect, seekBarPoint, time);
  }
}

/**
 * {@link PlayProgressBar}의 기본 옵션.
 *
 * @type {객체}
 * @사적인
 */
PlayProgressBar.prototype.options_ = {
  어린이들: []
};

// 시간 도구 설명은 모바일 장치의 플레이어에 추가하면 안 됩니다.
만약 (!IS_IOS && !IS_ANDROID) {
  PlayProgressBar.prototype.options_.children.push('timeTooltip');
}

Component.registerComponent('PlayProgressBar', PlayProgressBar);
기본 PlayProgressBar 내보내기;