<commit_before>class @Video
  constructor: (element) ->
    @el = $(element).find('.video')
    @id = @el.attr('id').replace(/video_/, '')
    @start = @el.data('start')
    @end = @el.data('end')
    @caption_asset_path = @el.data('caption-asset-path')
    @show_captions = @el.data('show-captions')
    window.player = null
    @el = $("#video_#{@id}")
    @parseVideos()
    @fetchMetadata()
    @parseSpeed()
    $("#video_#{@id}").data('video', this).addClass('video-load-complete')

    @hide_captions = $.cookie('hide_captions') == 'true' or (not @show_captions)

    if YT.Player
      @embed()
    else
      window.onYouTubePlayerAPIReady = =>
        @el.each ->
          $(this).data('video').embed()

  youtubeId: (speed)->
    @videos[speed || @speed]

  parseVideos: (videos) ->
    @videos =
      '0.75': @el.data('youtube-id-0-75')
      '1.0': @el.data('normal-speed-video-id')
      '1.25': @el.data('youtube-id-1-25')
      '1.50': @el.data('youtube-id-1-5')
<commit_msg>Prevent showing video speeds that aren't set by course author.<commit_after>class @Video
  constructor: (element) ->
    @el = $(element).find('.video')
    @id = @el.attr('id').replace(/video_/, '')
    @start = @el.data('start')
    @end = @el.data('end')
    @caption_asset_path = @el.data('caption-asset-path')
    @show_captions = @el.data('show-captions')
    window.player = null
    @el = $("#video_#{@id}")
    @parseVideos()
    @fetchMetadata()
    @parseSpeed()
    $("#video_#{@id}").data('video', this).addClass('video-load-complete')

    @hide_captions = $.cookie('hide_captions') == 'true' or (not @show_captions)

    if YT.Player
      @embed()
    else
      window.onYouTubePlayerAPIReady = =>
        @el.each ->
          $(this).data('video').embed()

  youtubeId: (speed)->
    @videos[speed || @speed]

  parseVideos: (videos) ->
    @videos = {}
    if @el.data('youtube-id-0-75')
      @videos['0.75'] = @el.data('youtube-id-0-75')
    if @el.data('normal-speed-video-id')
      @videos['1.0'] = @el.data('normal-speed-video-id')
    if @el.data('youtube-id-1-25')
      @videos['1.25'] = @el.data('youtube-id-1-25')
    if @el.data('youtube-id-1-5')
      @videos['1.50'] = @el.data('youtube-id-1-5')

{'fraction_non_alphanumeric': 0.22582096266306792, 'fraction_numerical': 0.0206927575348628, 'mean_word_length': 2.985663082437276, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '2764028', 'n_tokens_mistral': 870, 'n_tokens_neox': 832, 'n_words': 123}