Commit 5465bda5 by Peter Fogg

Use MITX_FEATURES to tell if we're in the CMS; this is much cleaner. Also use…

Use MITX_FEATURES to tell if we're in the CMS; this is much cleaner. Also use $.data instead of a hidden div.
parent 3bfe3de6
......@@ -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
......
......@@ -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) =>
......
......@@ -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
})
......
......@@ -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
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