use one general dictionary self.sources for videoalpha_module
This commit is contained in:
@@ -43,10 +43,12 @@ class VideoAlphaModule(XModule):
|
|||||||
self.sub = xmltree.get('sub')
|
self.sub = xmltree.get('sub')
|
||||||
self.position = 0
|
self.position = 0
|
||||||
self.show_captions = xmltree.get('show_captions', 'true')
|
self.show_captions = xmltree.get('show_captions', 'true')
|
||||||
self.source = self._get_source(xmltree)
|
self.sources = {
|
||||||
self.mp4_source = self._get_source(xmltree, ['mp4'])
|
'main': self._get_source(xmltree),
|
||||||
self.webm_source = self._get_source(xmltree, ['webm'])
|
'mp4': self._get_source(xmltree, ['mp4']),
|
||||||
self.ogv_source = self._get_source(xmltree, ['ogv'])
|
'webm': self._get_source(xmltree, ['webm']),
|
||||||
|
'ogv': self._get_source(xmltree, ['ogv']),
|
||||||
|
}
|
||||||
self.track = self._get_track(xmltree)
|
self.track = self._get_track(xmltree)
|
||||||
self.start_time, self.end_time = self._get_timeframe(xmltree)
|
self.start_time, self.end_time = self._get_timeframe(xmltree)
|
||||||
|
|
||||||
@@ -127,7 +129,7 @@ class VideoAlphaModule(XModule):
|
|||||||
return self.youtube
|
return self.youtube
|
||||||
|
|
||||||
def get_html(self):
|
def get_html(self):
|
||||||
if isinstance(modulestore(), MongoModuleStore) :
|
if isinstance(modulestore(), MongoModuleStore):
|
||||||
caption_asset_path = StaticContent.get_base_url_path_for_course_assets(self.location) + '/subs_'
|
caption_asset_path = StaticContent.get_base_url_path_for_course_assets(self.location) + '/subs_'
|
||||||
else:
|
else:
|
||||||
# VS[compat]
|
# VS[compat]
|
||||||
@@ -138,11 +140,8 @@ class VideoAlphaModule(XModule):
|
|||||||
'streams': self.videoalpha_list(),
|
'streams': self.videoalpha_list(),
|
||||||
'id': self.location.html_id(),
|
'id': self.location.html_id(),
|
||||||
'position': self.position,
|
'position': self.position,
|
||||||
'mp4_source': self.mp4_source,
|
|
||||||
'webm_source': self.webm_source,
|
|
||||||
'ogv_source': self.ogv_source,
|
|
||||||
'sub': self.sub,
|
'sub': self.sub,
|
||||||
'source': self.source,
|
'sources': self.sources,
|
||||||
'track': self.track,
|
'track': self.track,
|
||||||
'display_name': self.display_name,
|
'display_name': self.display_name,
|
||||||
# TODO (cpennington): This won't work when we move to data that isn't on the filesystem
|
# TODO (cpennington): This won't work when we move to data that isn't on the filesystem
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
class="video"
|
class="video"
|
||||||
data-streams="${streams}"
|
data-streams="${streams}"
|
||||||
${'data-sub="{}"'.format(sub) if sub else ''}
|
${'data-sub="{}"'.format(sub) if sub else ''}
|
||||||
${'data-mp4-source="{}"'.format(mp4_source) if mp4_source else ''}
|
${'data-mp4-source="{}"'.format(sources.get('mp4')) if sources.get('mp4') else ''}
|
||||||
${'data-webm-source="{}"'.format(webm_source) if webm_source else ''}
|
${'data-webm-source="{}"'.format(sources.get('webm')) if sources.get('webm') else ''}
|
||||||
${'data-ogg-source="{}"'.format(ogv_source) if ogv_source else ''}
|
${'data-ogg-source="{}"'.format(sources.get('ogv')) if sources.get('ogv') else ''}
|
||||||
data-caption-data-dir="${data_dir}"
|
data-caption-data-dir="${data_dir}"
|
||||||
data-show-captions="${show_captions}"
|
data-show-captions="${show_captions}"
|
||||||
data-start="${start}"
|
data-start="${start}"
|
||||||
@@ -30,9 +30,9 @@
|
|||||||
</div>
|
</div>
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
% if source:
|
% if sources.get('main'):
|
||||||
<div class="video-sources">
|
<div class="video-sources">
|
||||||
<p>Download video <a href="${source}">here</a>.</p>
|
<p>Download video <a href="${source.get('main')}">here</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user