diff --git a/cms/envs/common.py b/cms/envs/common.py index 90e15186d74a52d2c2c547701424547b5d3c0048..3f322b500179174d21323f468e416d31644502e9 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -40,7 +40,10 @@ MITX_FEATURES = { 'SEGMENT_IO': True, # Enable URL that shows information about the status of various services - 'ENABLE_SERVICE_STATUS': False + 'ENABLE_SERVICE_STATUS': False, + + # We're in the CMS. + 'IN_CMS': True } ENABLE_JASMINE = False diff --git a/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee b/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee index f02386dc43a07fdb60facf24233c42f0f64e8611..47f822bd927935d008672f86444a784cee687657 100644 --- a/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee +++ b/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee @@ -66,7 +66,7 @@ class @VideoPlayer extends Subview at: 'top center' onReady: (event) => - unless onTouchBasedDevice() or $('#in_lms').hasClass('false') + unless onTouchBasedDevice() or $('.video:first').data('in-cms') $('.video-load-complete:first').data('video').player.play() onStateChange: (event) => diff --git a/common/lib/xmodule/xmodule/video_module.py b/common/lib/xmodule/xmodule/video_module.py index 9e2ca892e26312f6f5cdee40ff55f1b3da988021..f902a9665bef0d4aa55d87262d271f02a7345b8c 100644 --- a/common/lib/xmodule/xmodule/video_module.py +++ b/common/lib/xmodule/xmodule/video_module.py @@ -139,8 +139,7 @@ class VideoModule(VideoFields, XModule): 'show_captions': self.show_captions, 'start': self.start_time, 'end': self.end_time, - 'normal_speed_video_id': normal_speed_video_id, - 'in_lms': not self.system.debug + 'normal_speed_video_id': normal_speed_video_id }) diff --git a/lms/templates/video.html b/lms/templates/video.html index 558c7acec2743be523516a477b867b5bfc27e865..0bbcf046cddd90d6bbf5adaca17660b8a475e3b9 100644 --- a/lms/templates/video.html +++ b/lms/templates/video.html @@ -16,7 +16,7 @@ width="640" height="390"></embed> </object> %else: - <div id="video_${id}" class="video" data-streams="${streams}" data-show-captions="${show_captions}" data-start="${start}" data-end="${end}" data-caption-asset-path="${caption_asset_path}"> + <div id="video_${id}" class="video" data-streams="${streams}" data-show-captions="${show_captions}" data-start="${start}" data-end="${end}" data-caption-asset-path="${caption_asset_path}" data-in-cms="${settings.MITX_FEATURES.get('IN_CMS', False)}"> <div class="tc-wrapper"> <article class="video-wrapper"> <section class="video-player"> @@ -39,9 +39,3 @@ <p>Download subtitles <a href="${track}">here</a>.</p> </div> % endif - -%if in_lms: -<div id="in_lms" class="true" style="display: none;"></div> -%else: -<div id="in_lms" class="false" style="display: none;"></div> -%endif