<commit_before>class Popout

  constructor: ->
    @getVideoIdAndCurrentTime => @setUpPlayer => @loadVideo => @loadAPI()

  loadVideo: (callback)->
    iframe                 = document.createElement('iframe')
    iframe.id              = 'player'
    iframe.frameborder     = '0'
    iframe.allowfullscreen = '1'
    iframe.title           = 'YouTube video player'
    iframe.width           = '100%'
    iframe.height          = '100%'
    iframe.src             = [
      "https://www.youtube.com/embed/#{@videoId}"
      '?enablejsapi=1'
    ].join('')
    document.body.appendChild iframe
    callback()

  loadAPI: ->
    script = document.createElement('script')
    script.src = 'https://www.youtube.com/iframe_api'
    firstScript = document.getElementsByTagName('script')[0]
    firstScript.parentNode.insertBefore(script, firstScript)

  setUpPlayer: (callback)->
    window.onYouTubeIframeAPIReady = =>
      @player = new YT.Player('player', {<commit_msg>Fix fullscreen<commit_after>class Popout

  constructor: ->
    @getVideoIdAndCurrentTime => @setUpPlayer => @loadVideo => @loadAPI()

  loadVideo: (callback)->
    iframe        = document.createElement('iframe')
    iframe.id     = 'player'
    iframe.title  = 'YouTube video player'
    iframe.width  = '100%'
    iframe.height = '100%'
    iframe.src    = "https://www.youtube.com/embed/#{@videoId}?enablejsapi=1"

    iframe.setAttribute 'frameborder', '0'
    iframe.setAttribute 'allowfullscreen', ''

    document.body.appendChild iframe
    callback()

  loadAPI: ->
    script = document.createElement('script')
    script.src = 'https://www.youtube.com/iframe_api'
    firstScript = document.getElementsByTagName('script')[0]
    firstScript.parentNode.insertBefore(script, firstScript)

  setUpPlayer: (callback)->
    window.onYouTubeIframeAPIReady = =>
      @player = new YT.Player('player', {
{'fraction_non_alphanumeric': 0.14019189765458423, 'fraction_numerical': 0.010127931769722815, 'mean_word_length': 2.9936170212765956, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '1730195', 'n_tokens_mistral': 615, 'n_tokens_neox': 564, 'n_words': 94}