Commit 5355b4b9 by Nimisha Asthagiri

MA-81 Honor video download setting with VAL-enabled videos.

parent 03b41032
...@@ -207,7 +207,7 @@ class VideoModule(VideoFields, VideoTranscriptsMixin, VideoStudentViewHandlers, ...@@ -207,7 +207,7 @@ class VideoModule(VideoFields, VideoTranscriptsMixin, VideoStudentViewHandlers,
# VAL will always give us the keys for the profiles we asked for, but # 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 # if it doesn't have an encoded video entry for that Video + Profile, the
# value will map to `None` # 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"] download_video_link = val_video_urls["desktop_mp4"]
if val_video_urls["youtube"]: if val_video_urls["youtube"]:
youtube_streams = "1.00:{}".format(val_video_urls["youtube"]) youtube_streams = "1.00:{}".format(val_video_urls["youtube"])
......
...@@ -441,8 +441,10 @@ class TestGetHtmlMethod(BaseTestXmodule): ...@@ -441,8 +441,10 @@ class TestGetHtmlMethod(BaseTestXmodule):
{sources} {sources}
</video> </video>
""" """
data = { 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', 'source': 'example_source.mp4',
'sources': """ 'sources': """
<source src="example.mp4"/> <source src="example.mp4"/>
...@@ -450,12 +452,11 @@ class TestGetHtmlMethod(BaseTestXmodule): ...@@ -450,12 +452,11 @@ class TestGetHtmlMethod(BaseTestXmodule):
""", """,
'edx_video_id': "mock item", 'edx_video_id': "mock item",
'result': { 'result': {
'download_video_link': u'http://www.meowmix.com', 'download_video_link': None,
'sources': json.dumps([u'example.mp4', u'example.webm']), 'sources': json.dumps([u'example.mp4', u'example.webm']),
} }
} }
# Video found for edx_video_id # Video found for edx_video_id
initial_context = { initial_context = {
'data_dir': getattr(self, 'data_dir', None), 'data_dir': getattr(self, 'data_dir', None),
......
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