-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Valera/no autoplay videoalpha studio #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
66e106a
4c544d6
9f4dcbc
72d7c9c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| 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 @@ def get_html(self): | |
| '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) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rocha Removed templates access from |
||
| }) | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| Feature: Video Alpha component | ||
| As a student, I want to view course videos in LMS. | ||
|
|
||
| Scenario: Autoplay is enabled in LMS | ||
| Given the course has a Video component | ||
| Then when I view the video it has autoplay enabled |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #pylint: disable=C0111 | ||
| #pylint: disable=W0613 | ||
| #pylint: disable=W0621 | ||
|
|
||
| from lettuce import world, step | ||
| from lettuce.django import django_url | ||
| from common import TEST_COURSE_NAME, TEST_SECTION_NAME, i_am_registered_for_the_course, section_location | ||
|
|
||
| ############### ACTIONS #################### | ||
|
|
||
|
|
||
| @step('when I view the video it has autoplay enabled') | ||
| def does_autoplay(step): | ||
| assert(world.css_find('.videoalpha')[0]['data-autoplay'] == 'True') | ||
|
|
||
|
|
||
| @step('the course has a Video component') | ||
| def view_videoalpha(step): | ||
| coursename = TEST_COURSE_NAME.replace(' ', '_') | ||
| i_am_registered_for_the_course(step, coursename) | ||
|
|
||
| # Make sure we have a videoalpha | ||
| add_videoalpha_to_course(coursename) | ||
| chapter_name = TEST_SECTION_NAME.replace(" ", "_") | ||
| section_name = chapter_name | ||
| url = django_url('/courses/edx/Test_Course/Test_Course/courseware/%s/%s' % | ||
| (chapter_name, section_name)) | ||
|
|
||
| world.browser.visit(url) | ||
|
|
||
|
|
||
| def add_videoalpha_to_course(course): | ||
| template_name = 'i4x://edx/templates/videoalpha/default' | ||
| world.ItemFactory.create(parent_location=section_location(course), | ||
| template=template_name, | ||
| display_name='Video Alpha 1') |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ <h2> ${display_name} </h2> | |
| data-start="${start}" | ||
| data-end="${end}" | ||
| data-caption-asset-path="${caption_asset_path}" | ||
| data-autoplay="${autoplay}" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rocha The value was moved outside the template. |
||
| > | ||
| <div class="tc-wrapper"> | ||
| <article class="video-wrapper"> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rocha Refactored the double negative.