<commit_before>jQuery ($) ->
  $movies = $('section.movies')
  $videoBox = $movies.find('.bc-video-box')
  bcPlayer = false

  $movies.find(".show-inline").click ->
    $videoId = $(@).attr('data-video-id')
    if bcPlayer
      showVideo $videoId
    else
      $.ajax
        dataType: 'script'
        cache: true
        url: '//players.brightcove.net/745456160001/ac887454-ec8b-4ffc-a530-4af5c1c8e8c7_default/index.min.js'
        success: ->
          bcPlayer = videojs('bc-video')
          showVideo $videoId
          return
    return

  showVideo = ($videoId) ->
    $videoBox.slideDown 200
    $('html, body').animate
      scrollTop: $(".movies").offset().top - 45
    , 200

    # FIXME: use $videoId to set video and let BC select media type
    bcPlayer.src([
      {
        "type":"video/mp4",
        "src": "http://brightcove.vo.llnwd.net/v1/uds/pd/745456160001/201503/1629/745456160001_4144200317001_4144112584001.mp4"
      }
    ])
    bcPlayer.play()
    return
  return<commit_msg>Changed API call based on input from @carlhaman in https://github.com/malmostad/sitevision_assets/issues/274#issuecomment-100228565<commit_after>jQuery ($) ->
  $movies = $('section.movies')
  $videoBox = $movies.find('.bc-video-box')
  bcPlayer = false

  $movies.find(".show-inline").click ->
    $videoId = $(@).attr('data-video-id')
    if bcPlayer
      showVideo $videoId
    else
      $.ajax
        dataType: 'script'
        cache: true
        url: '//players.brightcove.net/745456160001/ac887454-ec8b-4ffc-a530-4af5c1c8e8c7_default/index.min.js'
        success: ->
          bcPlayer = videojs('bc-video')
          showVideo $videoId
          return
    return

  showVideo = ($videoId) ->
    $videoBox.slideDown 200
    $('html, body').animate
      scrollTop: $(".movies").offset().top - 45
    , 200

    bcPlayer.catalog.getVideo $videoId, (error, video) ->
      bcPlayer.catalog.load(video)
      bcPlayer.play()
      return
    return
  return
{'fraction_non_alphanumeric': 0.14792299898682879, 'fraction_numerical': 0.07548125633232017, 'mean_word_length': 2.4710017574692444, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 1, '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': '4721774', 'n_tokens_mistral': 789, 'n_tokens_neox': 686, 'n_words': 114}