<commit_before>// Copyright 2014 Globo.com Player authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

import {formatTime} from 'base/utils'

import UIObject from 'base/ui_object'
import Styler from 'base/styler'
import template from 'base/template'
import Events from 'base/events'
import seekTimeStyle from './public/seek_time.scss'
import seekTimeHTML from './public/seek_time.html'

export default class SeekTime extends UIObject {
  get name() { return 'seek_time' }
  get template() {
    return template(seekTimeHTML)
  }
  get attributes() {
    return {
      'class': 'seek-time',
      'data-seek-time': ''
    }
  }
  constructor(mediaControl) {
    super()
    this.mediaControl = mediaControl
    this.mediaControlContainer = this.mediaControl.container
    this.rendered = false
    this.hoveringOverSeekBar = false
    this.hoverPosition = null
    this.duration = null
    this.actualLiveTime = !!this.mediaControl.options.actualLiveTime
    if (this.actualLiveTime) {
      if (!!this.mediaControl.options.actualLiveServerTime) {
        this.actualLiveServerTimeDiff = new Date().getTime() - new Date(this.mediaControl.options.actualLiveServerTime).getTime()
      } else {
        this.actualLiveServerTimeDiff = 0
      }
    }
    console.log("actualLiveServerTimeDiff: " + formatTime(this.actualLiveServerTimeDiff / 1000))
    this.durationShown = false
    this.addEventListeners()
  }

  addEventListeners() {
    this.listenTo(this.mediaControl, Events.MEDIACONTROL_MOUSEMOVE_SEEKBAR, this.showTime)
    this.listenTo(this.mediaControl, Events.MEDIACONTROL_MOUSELEAVE_SEEKBAR, this.hideTime)
    this.listenTo(this.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.onContainerChanged)
    this.listenTo(this.mediaControlContainer, Events.CONTAINER_TIMEUPDATE, this.updateDuration)
  }

  onContainerChanged() {
     this.stopListening(this.mediaControlContainer, Events.CONTAINER_TIMEUPDATE, this.updateDuration)
     this.mediaControlContainer = this.mediaControl.container
     this.listenTo(this.mediaControlContainer, Events.CONTAINER_TIMEUPDATE, this.updateDuration)
  }
<commit_msg>Sneeky console.log...<commit_after>// Copyright 2014 Globo.com Player authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

import {formatTime} from 'base/utils'

import UIObject from 'base/ui_object'
import Styler from 'base/styler'
import template from 'base/template'
import Events from 'base/events'
import seekTimeStyle from './public/seek_time.scss'
import seekTimeHTML from './public/seek_time.html'

export default class SeekTime extends UIObject {
  get name() { return 'seek_time' }
  get template() {
    return template(seekTimeHTML)
  }
  get attributes() {
    return {
      'class': 'seek-time',
      'data-seek-time': ''
    }
  }
  constructor(mediaControl) {
    super()
    this.mediaControl = mediaControl
    this.mediaControlContainer = this.mediaControl.container
    this.rendered = false
    this.hoveringOverSeekBar = false
    this.hoverPosition = null
    this.duration = null
    this.actualLiveTime = !!this.mediaControl.options.actualLiveTime
    if (this.actualLiveTime) {
      if (!!this.mediaControl.options.actualLiveServerTime) {
        this.actualLiveServerTimeDiff = new Date().getTime() - new Date(this.mediaControl.options.actualLiveServerTime).getTime()
      } else {
        this.actualLiveServerTimeDiff = 0
      }
    }
    this.durationShown = false
    this.addEventListeners()
  }

  addEventListeners() {
    this.listenTo(this.mediaControl, Events.MEDIACONTROL_MOUSEMOVE_SEEKBAR, this.showTime)
    this.listenTo(this.mediaControl, Events.MEDIACONTROL_MOUSELEAVE_SEEKBAR, this.hideTime)
    this.listenTo(this.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.onContainerChanged)
    this.listenTo(this.mediaControlContainer, Events.CONTAINER_TIMEUPDATE, this.updateDuration)
  }

  onContainerChanged() {
     this.stopListening(this.mediaControlContainer, Events.CONTAINER_TIMEUPDATE, this.updateDuration)
     this.mediaControlContainer = this.mediaControl.container
     this.listenTo(this.mediaControlContainer, Events.CONTAINER_TIMEUPDATE, this.updateDuration)
  }

{'fraction_non_alphanumeric': 0.09705814222839936, 'fraction_numerical': 0.0032429928190873293, 'mean_word_length': 4.158900836320191, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '233991', 'n_tokens_mistral': 1315, 'n_tokens_neox': 1296, 'n_words': 262}