diff --git a/common/lib/xmodule/xmodule/js/src/video/display.coffee b/common/lib/xmodule/xmodule/js/src/video/display.coffee index 3880091661..90e465d0ec 100644 --- a/common/lib/xmodule/xmodule/js/src/video/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/video/display.coffee @@ -9,6 +9,12 @@ class @Video @parseVideos @el.data('streams') @fetchMetadata() @parseSpeed() + + if $.cookie('hide_captions') == 'true' + @el.addClass('closed') + else + @el.removeClass('closed') + $("#video_#{@id}").data('video', this).addClass('video-load-complete') if YT.Player diff --git a/common/lib/xmodule/xmodule/js/src/video/display/video_caption.coffee b/common/lib/xmodule/xmodule/js/src/video/display/video_caption.coffee index f65debb1a2..ae6b0c8ed1 100644 --- a/common/lib/xmodule/xmodule/js/src/video/display/video_caption.coffee +++ b/common/lib/xmodule/xmodule/js/src/video/display/video_caption.coffee @@ -1,6 +1,6 @@ class @VideoCaption extends Subview initialize: -> - @loaded = false + @loaded = false bind: -> $(window).bind('resize', @resize) @@ -49,7 +49,7 @@ class @VideoCaption extends Subview @$('.subtitles').html(container.html()) @$('.subtitles li[data-index]').click @seekPlayer - # prepend and append an empty
  • for cosmatic reason + # prepend and append an empty
  • for cosmetic reason @$('.subtitles').prepend($('
  • ').height(@topSpacingHeight())) .append($('
  • ').height(@bottomSpacingHeight())) @@ -131,10 +131,12 @@ class @VideoCaption extends Subview toggle: (event) => event.preventDefault() if @el.hasClass('closed') + $.cookie('hide_captions', 'false', expires: 3650, path: '/') @$('.hide-subtitles').attr('title', 'Turn off captions') @el.removeClass('closed') @scrollCaption() else + $.cookie('hide_captions', 'true', expires: 3650, path: '/') @$('.hide-subtitles').attr('title', 'Turn on captions') @el.addClass('closed')