diff --git a/common/lib/xmodule/xmodule/js/src/video/display.coffee b/common/lib/xmodule/xmodule/js/src/video/display.coffee index ecf9ee1a72..3880091661 100644 --- a/common/lib/xmodule/xmodule/js/src/video/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/video/display.coffee @@ -3,6 +3,7 @@ class @Video @el = $(element).find('.video') @id = @el.attr('id').replace(/video_/, '') @caption_data_dir = @el.data('caption-data-dir') + @show_captions = @el.data('show-captions') == "true" window.player = null @el = $("#video_#{@id}") @parseVideos @el.data('streams') 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 3094cc5119..f65debb1a2 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 @@ -13,8 +13,12 @@ class @VideoCaption extends Subview "/static/#{@captionDataDir}/subs/#{@youtubeId}.srt.sjson" render: -> + # TODO: make it so you can have a video with no captions. + #@$('.video-wrapper').after """ + #
  1. Attempting to load captions...
+ # """ @$('.video-wrapper').after """ -
  1. Attempting to load captions...
+
    """ @$('.video-controls .secondary-controls').append """ Captions diff --git a/common/lib/xmodule/xmodule/video_module.py b/common/lib/xmodule/xmodule/video_module.py index 7d11dea283..a18a470272 100644 --- a/common/lib/xmodule/xmodule/video_module.py +++ b/common/lib/xmodule/xmodule/video_module.py @@ -30,6 +30,7 @@ class VideoModule(XModule): xmltree = etree.fromstring(self.definition['data']) self.youtube = xmltree.get('youtube') self.position = 0 + self.show_captions = xmltree.get('show_captions', 'true') if instance_state is not None: state = json.loads(instance_state) @@ -75,6 +76,7 @@ class VideoModule(XModule): 'display_name': self.display_name, # TODO (cpennington): This won't work when we move to data that isn't on the filesystem 'data_dir': self.metadata['data_dir'], + 'show_captions': self.show_captions }) diff --git a/lms/templates/video.html b/lms/templates/video.html index fcf25f3d69..bd3ec77fbe 100644 --- a/lms/templates/video.html +++ b/lms/templates/video.html @@ -2,7 +2,7 @@

    ${display_name}

    % endif -
    +