MA-81 Honor video download setting with VAL-enabled videos.
This commit is contained in:
@@ -207,7 +207,7 @@ class VideoModule(VideoFields, VideoTranscriptsMixin, VideoStudentViewHandlers,
|
||||
# VAL will always give us the keys for the profiles we asked for, but
|
||||
# if it doesn't have an encoded video entry for that Video + Profile, the
|
||||
# value will map to `None`
|
||||
if val_video_urls["desktop_mp4"]:
|
||||
if val_video_urls["desktop_mp4"] and self.download_video:
|
||||
download_video_link = val_video_urls["desktop_mp4"]
|
||||
if val_video_urls["youtube"]:
|
||||
youtube_streams = "1.00:{}".format(val_video_urls["youtube"])
|
||||
|
||||
@@ -441,8 +441,10 @@ class TestGetHtmlMethod(BaseTestXmodule):
|
||||
{sources}
|
||||
</video>
|
||||
"""
|
||||
|
||||
data = {
|
||||
'download_video': 'true',
|
||||
# test with download_video set to false and make sure download_video_link is not set (is None)
|
||||
'download_video': 'false',
|
||||
'source': 'example_source.mp4',
|
||||
'sources': """
|
||||
<source src="example.mp4"/>
|
||||
@@ -450,12 +452,11 @@ class TestGetHtmlMethod(BaseTestXmodule):
|
||||
""",
|
||||
'edx_video_id': "mock item",
|
||||
'result': {
|
||||
'download_video_link': u'http://www.meowmix.com',
|
||||
'download_video_link': None,
|
||||
'sources': json.dumps([u'example.mp4', u'example.webm']),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Video found for edx_video_id
|
||||
initial_context = {
|
||||
'data_dir': getattr(self, 'data_dir', None),
|
||||
|
||||
Reference in New Issue
Block a user