Commit 72d7c9ca by Valera Rozuvan

Moved the definition of autoplay attribute to videoalpha_module.py file. Changed…

Moved the definition of autoplay attribute to videoalpha_module.py file. Changed double negative if statement for autoplay check to simple if.
parent 9f4dcbcd
......@@ -99,7 +99,7 @@ class @VideoPlayerAlpha extends SubviewAlpha
@video.log 'load_video'
if @video.videoType is 'html5'
@player.setPlaybackRate @video.speed
unless onTouchBasedDevice() or $('.video:first').data('autoplay') == 'False'
if not onTouchBasedDevice() and $('.video:first').data('autoplay') is 'True'
$('.video-load-complete:first').data('video').player.play()
onStateChange: (event) =>
......
......@@ -5,6 +5,7 @@ from lxml import etree
from pkg_resources import resource_string, resource_listdir
from django.http import Http404
from django.conf import settings
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
......@@ -147,7 +148,8 @@ class VideoAlphaModule(VideoAlphaFields, XModule):
'caption_asset_path': caption_asset_path,
'show_captions': self.show_captions,
'start': self.start_time,
'end': self.end_time
'end': self.end_time,
'autoplay': settings.MITX_FEATURES.get('AUTOPLAY_VIDEOS', True)
})
......
......@@ -18,7 +18,7 @@
data-start="${start}"
data-end="${end}"
data-caption-asset-path="${caption_asset_path}"
data-autoplay="${settings.MITX_FEATURES['AUTOPLAY_VIDEOS']}"
data-autoplay="${autoplay}"
>
<div class="tc-wrapper">
<article class="video-wrapper">
......
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