Commit 2d7f1b73 by Chris Dodge

consolidate logic to compute caption path to server-side, we don't need to do this client-side

parent 71f16d40
......@@ -10,10 +10,7 @@ class @VideoCaption extends Subview
.bind('DOMMouseScroll', @onMovement)
captionURL: ->
if @captionAssetPath != ''
"#{@captionAssetPath}/#{@youtubeId}.srt.sjson"
else
"/static/#{@captionDataDir}/subs/#{@youtubeId}.srt.sjson"
"#{@captionAssetPath}/#{@youtubeId}.srt.sjson"
render: ->
# TODO: make it so you can have a video with no captions.
......
......@@ -31,7 +31,6 @@ class @VideoPlayer extends Subview
el: @el
youtubeId: @video.youtubeId('1.0')
currentSpeed: @currentSpeed()
captionDataDir: @video.caption_data_dir
captionAssetPath: @video.caption_asset_path
unless onTouchBasedDevice()
@volumeControl = new VideoVolumeControl el: @$('.secondary-controls')
......
......@@ -96,9 +96,12 @@ class VideoModule(XModule):
return self.youtube
def get_html(self):
caption_asset_path = ''
if isinstance(modulestore(), MongoModuleStore) :
caption_asset_path = StaticContent.get_base_url_path_for_course_assets(self.location)
else:
# VS[compat]
# cdodge: filesystem static content support.
caption_asset_path = "/static/{0}/subs".format(self.metadata['data_dir'])
return self.system.render_template('video.html', {
'streams': self.video_list(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment