Commit 438c92d8 by Calen Pennington

Get the video module pointing to the correct static files directory, without…

Get the video module pointing to the correct static files directory, without relying on get_html replacement
parent 551f2654
class @Video
constructor: (@element) ->
@id = $(@element).attr('id').replace(/video_/, '')
@caption_url_base = $(@element).data('caption-url-base')
@caption_data_dir = $(@element).data('caption-data-dir')
window.player = null
@el = $("#video_#{@id}")
@parseVideos $(@element).data('streams')
......
......@@ -7,7 +7,7 @@ class @VideoCaption extends Subview
.bind('DOMMouseScroll', @onMovement)
captionURL: ->
"#{@captionURLBase}/#{@youtubeId}.srt.sjson"
"/static/#{@captionDataDir}/subs/#{@youtubeId}.srt.sjson"
render: ->
@$('.video-wrapper').after """
......
......@@ -25,7 +25,11 @@ class @VideoPlayer extends Subview
render: ->
@control = new VideoControl el: @$('.video-controls')
@caption = new VideoCaption el: @el, youtubeId: @video.youtubeId('1.0'), currentSpeed: @currentSpeed(), captionURLBase: @video.caption_url_base
@caption = new VideoCaption
el: @el
youtubeId: @video.youtubeId('1.0')
currentSpeed: @currentSpeed()
captionDataDir: @video.caption_data_dir
unless onTouchBasedDevice()
@volumeControl = new VideoVolumeControl el: @$('.secondary-controls')
@speedControl = new VideoSpeedControl el: @$('.secondary-controls'), speeds: @video.speeds, currentSpeed: @currentSpeed()
......
......@@ -71,6 +71,8 @@ class VideoModule(XModule):
'id': self.location.html_id(),
'position': self.position,
'name': self.name,
# TODO (cpennington): This won't work when we move to data that isn't on the filesystem
'data_dir': self.metadata['data_dir'],
})
......
......@@ -2,7 +2,7 @@
<h1> ${name} </h1>
% endif
<div id="video_${id}" class="video" data-streams="${streams}" data-caption-url-base="/static/subs">
<div id="video_${id}" class="video" data-streams="${streams}" data-caption-data-dir="${data_dir}">
<div class="tc-wrapper">
<article class="video-wrapper">
<section class="video-player">
......
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