From 7af892e66a2c966415e29e1e7ccec2b10f45caa3 Mon Sep 17 00:00:00 2001 From: jmclaus Date: Wed, 18 Sep 2013 18:34:53 +0200 Subject: [PATCH] Disabled video autoplay for students --- common/lib/xmodule/xmodule/js/src/video/03_video_player.js | 3 +++ lms/djangoapps/courseware/tests/test_video_mongo.py | 2 +- lms/djangoapps/courseware/tests/test_video_xml.py | 2 +- lms/envs/common.py | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/video/03_video_player.js b/common/lib/xmodule/xmodule/js/src/video/03_video_player.js index 649dd9cf66..03fcb19351 100644 --- a/common/lib/xmodule/xmodule/js/src/video/03_video_player.js +++ b/common/lib/xmodule/xmodule/js/src/video/03_video_player.js @@ -420,12 +420,15 @@ function (HTML5Video) { this.videoPlayer.player.setPlaybackRate(this.speed); } + /* The following has been commented out to make sure autoplay is + disabled for students. if ( !onTouchBasedDevice() && $('.video:first').data('autoplay') === 'True' ) { this.videoPlayer.play(); } + */ } function onStateChange(event) { diff --git a/lms/djangoapps/courseware/tests/test_video_mongo.py b/lms/djangoapps/courseware/tests/test_video_mongo.py index ea4949e4c9..75cf55c1cc 100644 --- a/lms/djangoapps/courseware/tests/test_video_mongo.py +++ b/lms/djangoapps/courseware/tests/test_video_mongo.py @@ -61,7 +61,7 @@ class TestVideo(BaseTestXmodule): 'sub': u'a_sub_file.srt.sjson', 'track': '', 'youtube_streams': _create_youtube_string(self.item_module), - 'autoplay': settings.MITX_FEATURES.get('AUTOPLAY_VIDEOS', True), + 'autoplay': settings.MITX_FEATURES.get('AUTOPLAY_VIDEOS', False), 'yt_test_timeout': 1500, 'yt_test_url': 'https://gdata.youtube.com/feeds/api/videos/' } diff --git a/lms/djangoapps/courseware/tests/test_video_xml.py b/lms/djangoapps/courseware/tests/test_video_xml.py index ea17af723d..28cee28e7c 100644 --- a/lms/djangoapps/courseware/tests/test_video_xml.py +++ b/lms/djangoapps/courseware/tests/test_video_xml.py @@ -94,7 +94,7 @@ class VideoModuleUnitTest(unittest.TestCase): 'sources': sources, 'youtube_streams': _create_youtube_string(module), 'track': '', - 'autoplay': settings.MITX_FEATURES.get('AUTOPLAY_VIDEOS', True), + 'autoplay': settings.MITX_FEATURES.get('AUTOPLAY_VIDEOS', False), 'yt_test_timeout': 1500, 'yt_test_url': 'https://gdata.youtube.com/feeds/api/videos/' } diff --git a/lms/envs/common.py b/lms/envs/common.py index 3fa1918769..81b01179d7 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -144,8 +144,8 @@ MITX_FEATURES = { # Toggle to indicate use of a custom theme 'USE_CUSTOM_THEME': False, - # Do autoplay videos for students - 'AUTOPLAY_VIDEOS': True, + # Don't autoplay videos for students + 'AUTOPLAY_VIDEOS': False, # Enable instructor dash to submit background tasks 'ENABLE_INSTRUCTOR_BACKGROUND_TASKS': True,