Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
d02d3b79
Commit
d02d3b79
authored
Jan 30, 2015
by
polesye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TNL-1299: Update default video.
parent
aba0fcd8
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
249 additions
and
96 deletions
+249
-96
cms/djangoapps/contentstore/features/video.py
+1
-1
cms/djangoapps/contentstore/features/video_editor.py
+2
-2
common/lib/xmodule/xmodule/tests/test_video.py
+1
-1
common/lib/xmodule/xmodule/video_module/video_module.py
+2
-2
common/lib/xmodule/xmodule/video_module/video_xfields.py
+1
-1
common/test/acceptance/pages/studio/video/video.py
+2
-2
common/test/acceptance/tests/helpers.py
+1
-1
common/test/acceptance/tests/video/test_studio_video_editor.py
+3
-3
common/test/acceptance/tests/video/test_studio_video_module.py
+3
-3
common/test/acceptance/tests/video/test_studio_video_transcript.py
+1
-1
common/test/acceptance/tests/video/test_video_module.py
+39
-39
common/test/acceptance/tests/video/test_video_times.py
+11
-25
common/test/data/uploads/subs_3_yD_cEKoCk.srt.sjson
+167
-0
lms/djangoapps/courseware/features/video.feature
+5
-5
lms/djangoapps/courseware/tests/test_video_mongo.py
+10
-10
No files found.
cms/djangoapps/contentstore/features/video.py
View file @
d02d3b79
...
...
@@ -52,7 +52,7 @@ def i_created_a_video_component(step):
@step
(
'I have created a Video component with subtitles$'
)
def
i_created_a_video_with_subs
(
_step
):
_step
.
given
(
'I have created a Video component with subtitles "
OEoXaMPEzfM
"'
)
_step
.
given
(
'I have created a Video component with subtitles "
3_yD_cEKoCk
"'
)
@step
(
'I have created a Video component with subtitles "([^"]*)"$'
)
...
...
cms/djangoapps/contentstore/features/video_editor.py
View file @
d02d3b79
...
...
@@ -142,7 +142,7 @@ def correct_video_settings(_step):
expected_entries
=
[
# basic
[
DISPLAY_NAME
,
'Video'
,
False
],
[
'Default Video URL'
,
'http://youtu.be/
OEoXaMPEzfM
, , '
,
False
],
[
'Default Video URL'
,
'http://youtu.be/
3_yD_cEKoCk
, , '
,
False
],
# advanced
[
DISPLAY_NAME
,
'Video'
,
False
],
...
...
@@ -156,7 +156,7 @@ def correct_video_settings(_step):
[
'Video File URLs'
,
''
,
False
],
[
'Video Start Time'
,
'00:00:00'
,
False
],
[
'Video Stop Time'
,
'00:00:00'
,
False
],
[
'YouTube ID'
,
'
OEoXaMPEzfM
'
,
False
],
[
'YouTube ID'
,
'
3_yD_cEKoCk
'
,
False
],
[
'YouTube ID for .75x speed'
,
''
,
False
],
[
'YouTube ID for 1.25x speed'
,
''
,
False
],
[
'YouTube ID for 1.5x speed'
,
''
,
False
]
...
...
common/lib/xmodule/xmodule/tests/test_video.py
View file @
d02d3b79
...
...
@@ -366,7 +366,7 @@ class VideoDescriptorImportTestCase(unittest.TestCase):
output
=
VideoDescriptor
.
from_xml
(
xml_data
,
module_system
,
Mock
())
self
.
assert_attributes_equal
(
output
,
{
'youtube_id_0_75'
:
''
,
'youtube_id_1_0'
:
'
OEoXaMPEzfM
'
,
'youtube_id_1_0'
:
'
3_yD_cEKoCk
'
,
'youtube_id_1_25'
:
''
,
'youtube_id_1_5'
:
''
,
'show_captions'
:
True
,
...
...
common/lib/xmodule/xmodule/video_module/video_module.py
View file @
d02d3b79
...
...
@@ -341,7 +341,7 @@ class VideoDescriptor(VideoFields, VideoTranscriptsMixin, VideoStudioViewHandler
one should compare own_metadata(self) and old_medatada.
Video player has two tabs, and due to nature of sync between tabs,
metadata from Basic tab is always sent when video player is edited and saved first time, for example:
{'youtube_id_1_0': u'
OEoXaMPEzfM', 'display_name': u'Video', 'sub': u'OEoXaMPEzfM
', 'html5_sources': []},
{'youtube_id_1_0': u'
3_yD_cEKoCk', 'display_name': u'Video', 'sub': u'3_yD_cEKoCk
', 'html5_sources': []},
that's why these fields will always present in old_metadata after first save. This should be fixed.
At consequent save requests html5_sources are always sent too, disregard of their change by user.
That means that html5_sources are always in list of fields that were changed (`metadata` param in save_item).
...
...
@@ -423,7 +423,7 @@ class VideoDescriptor(VideoFields, VideoTranscriptsMixin, VideoStudioViewHandler
youtube_string
=
create_youtube_string
(
self
)
# Mild workaround to ensure that tests pass -- if a field
# is set to its default value, we don't need to write it out.
if
youtube_string
and
youtube_string
!=
'1.00:
OEoXaMPEzfM
'
:
if
youtube_string
and
youtube_string
!=
'1.00:
3_yD_cEKoCk
'
:
xml
.
set
(
'youtube'
,
unicode
(
youtube_string
))
xml
.
set
(
'url_name'
,
self
.
url_name
)
attrs
=
{
...
...
common/lib/xmodule/xmodule/video_module/video_xfields.py
View file @
d02d3b79
...
...
@@ -31,7 +31,7 @@ class VideoFields(object):
help
=
_
(
"Optional, for older browsers: the YouTube ID for the normal speed video."
),
display_name
=
_
(
"YouTube ID"
),
scope
=
Scope
.
settings
,
default
=
"
OEoXaMPEzfM
"
default
=
"
3_yD_cEKoCk
"
)
youtube_id_0_75
=
String
(
help
=
_
(
"Optional, for older browsers: the YouTube ID for the .75x speed video."
),
...
...
common/test/acceptance/pages/studio/video/video.py
View file @
d02d3b79
...
...
@@ -53,7 +53,7 @@ DISPLAY_NAME = "Component Display Name"
DEFAULT_SETTINGS
=
[
# basic
[
DISPLAY_NAME
,
'Video'
,
False
],
[
'Default Video URL'
,
'http://youtu.be/
OEoXaMPEzfM
, , '
,
False
],
[
'Default Video URL'
,
'http://youtu.be/
3_yD_cEKoCk
, , '
,
False
],
# advanced
[
DISPLAY_NAME
,
'Video'
,
False
],
...
...
@@ -68,7 +68,7 @@ DEFAULT_SETTINGS = [
[
'Video File URLs'
,
''
,
False
],
[
'Video Start Time'
,
'00:00:00'
,
False
],
[
'Video Stop Time'
,
'00:00:00'
,
False
],
[
'YouTube ID'
,
'
OEoXaMPEzfM
'
,
False
],
[
'YouTube ID'
,
'
3_yD_cEKoCk
'
,
False
],
[
'YouTube ID for .75x speed'
,
''
,
False
],
[
'YouTube ID for 1.25x speed'
,
''
,
False
],
[
'YouTube ID for 1.5x speed'
,
''
,
False
]
...
...
common/test/acceptance/tests/helpers.py
View file @
d02d3b79
...
...
@@ -53,7 +53,7 @@ def is_youtube_available():
'metadata'
:
'http://gdata.youtube.com/feeds/api/videos/'
,
# For transcripts, you need to check an actual video, so we will
# just specify our default video and see if that one is available.
'transcript'
:
'http://video.google.com/timedtext?lang=en&v=
OEoXaMPEzfM
'
,
'transcript'
:
'http://video.google.com/timedtext?lang=en&v=
3_yD_cEKoCk
'
,
}
for
url
in
youtube_api_urls
.
itervalues
():
...
...
common/test/acceptance/tests/video/test_studio_video_editor.py
View file @
d02d3b79
...
...
@@ -25,7 +25,7 @@ class VideoEditorTest(CMSVideoBaseTest):
"""
if
subtitles
:
self
.
assets
.
append
(
'subs_
OEoXaMPEzfM
.srt.sjson'
)
self
.
assets
.
append
(
'subs_
3_yD_cEKoCk
.srt.sjson'
)
self
.
navigate_to_course_unit
()
...
...
@@ -345,7 +345,7 @@ class VideoEditorTest(CMSVideoBaseTest):
And I open tab "Advanced"
And I click button "Add"
And I choose "uk" language code
And I try to upload transcript file "subs_
OEoXaMPEzfM
.srt.sjson"
And I try to upload transcript file "subs_
3_yD_cEKoCk
.srt.sjson"
Then I see validation error "Only SRT files can be uploaded. Please select a file ending in .srt to upload."
"""
self
.
_create_video_component
()
...
...
@@ -353,7 +353,7 @@ class VideoEditorTest(CMSVideoBaseTest):
self
.
open_advanced_tab
()
self
.
video
.
click_button
(
'translation_add'
)
self
.
video
.
select_translation_language
(
'uk'
)
self
.
video
.
upload_asset
(
'subs_
OEoXaMPEzfM
.srt.sjson'
,
asset_type
=
'transcript'
)
self
.
video
.
upload_asset
(
'subs_
3_yD_cEKoCk
.srt.sjson'
,
asset_type
=
'transcript'
)
error_msg
=
'Only SRT files can be uploaded. Please select a file ending in .srt to upload.'
self
.
assertEqual
(
self
.
video
.
upload_status_message
,
error_msg
)
...
...
common/test/acceptance/tests/video/test_studio_video_module.py
View file @
d02d3b79
...
...
@@ -150,7 +150,7 @@ class CMSVideoTest(CMSVideoBaseTest):
YouTubeStubConfig
.
configure
(
youtube_stub_config
)
if
subtitles
:
self
.
assets
.
append
(
'subs_
OEoXaMPEzfM
.srt.sjson'
)
self
.
assets
.
append
(
'subs_
3_yD_cEKoCk
.srt.sjson'
)
self
.
navigate_to_course_unit
()
...
...
@@ -287,9 +287,9 @@ class CMSVideoTest(CMSVideoBaseTest):
self
.
video
.
show_captions
()
self
.
video
.
focus_caption_line
(
1
)
self
.
video
.
focus_caption_line
(
2
)
self
.
assertTrue
(
self
.
video
.
is_caption_line_focused
(
1
))
self
.
assertTrue
(
self
.
video
.
is_caption_line_focused
(
2
))
def
test_slider_range_works
(
self
):
"""
...
...
common/test/acceptance/tests/video/test_studio_video_transcript.py
View file @
d02d3b79
...
...
@@ -31,7 +31,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
def
setUp
(
self
):
super
(
VideoTranscriptTest
,
self
)
.
setUp
()
def
_create_video_component
(
self
,
subtitles
=
False
,
subtitle_id
=
'
OEoXaMPEzfM
'
):
def
_create_video_component
(
self
,
subtitles
=
False
,
subtitle_id
=
'
3_yD_cEKoCk
'
):
"""
Create a video component and navigate to unit page
...
...
common/test/acceptance/tests/video/test_video_module.py
View file @
d02d3b79
...
...
@@ -232,13 +232,13 @@ class YouTubeVideoTest(VideoBaseTest):
Then I see the correct english text in the captions
"""
self
.
_install_course_fixture
()
self
.
course_fixture
.
add_asset
([
'subs_
OEoXaMPEzfM
.srt.sjson'
])
self
.
course_fixture
.
add_asset
([
'subs_
3_yD_cEKoCk
.srt.sjson'
])
self
.
course_fixture
.
_upload_assets
()
self
.
_navigate_to_courseware_video_and_render
()
self
.
video
.
show_captions
()
# Verify that we see "
Hi, welcome to Edx
." text in the captions
self
.
assertIn
(
'
Hi, welcome to Edx
.'
,
self
.
video
.
captions_text
)
# Verify that we see "
Welcome to edX
." text in the captions
self
.
assertIn
(
'
Welcome to edX
.'
,
self
.
video
.
captions_text
)
def
test_cc_button_hidden_no_translations
(
self
):
"""
...
...
@@ -294,18 +294,18 @@ class YouTubeVideoTest(VideoBaseTest):
And I see the correct non-english text in the captions
And the non-english transcript downloads correctly
"""
self
.
assets
.
extend
([
'chinese_transcripts.srt'
,
'subs_
OEoXaMPEzfM
.srt.sjson'
])
data
=
{
'download_track'
:
True
,
'transcripts'
:
{
'zh'
:
'chinese_transcripts.srt'
},
'sub'
:
'
OEoXaMPEzfM
'
}
self
.
assets
.
extend
([
'chinese_transcripts.srt'
,
'subs_
3_yD_cEKoCk
.srt.sjson'
])
data
=
{
'download_track'
:
True
,
'transcripts'
:
{
'zh'
:
'chinese_transcripts.srt'
},
'sub'
:
'
3_yD_cEKoCk
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
# go to video
self
.
navigate_to_video
()
# check if "
Hi, welcome to Edx
." text in the captions
self
.
assertIn
(
'
Hi, welcome to Edx
.'
,
self
.
video
.
captions_text
)
# check if "
Welcome to edX
." text in the captions
self
.
assertIn
(
'
Welcome to edX
.'
,
self
.
video
.
captions_text
)
# check if we can download transcript in "srt" format that has text "
Hi, welcome to Edx
."
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
'
Hi, welcome to Edx
.'
))
# check if we can download transcript in "srt" format that has text "
Welcome to edX
."
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
'
Welcome to edX
.'
))
# select language with code "zh"
self
.
assertTrue
(
self
.
video
.
select_language
(
'zh'
))
...
...
@@ -328,8 +328,8 @@ class YouTubeVideoTest(VideoBaseTest):
Then the video with the transcript enabled is aligned correctly
And the video with the transcript hidden is aligned correctly
"""
self
.
assets
.
append
(
'subs_
OEoXaMPEzfM
.srt.sjson'
)
data
=
{
'sub'
:
'
OEoXaMPEzfM
'
}
self
.
assets
.
append
(
'subs_
3_yD_cEKoCk
.srt.sjson'
)
data
=
{
'sub'
:
'
3_yD_cEKoCk
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
# go to video
...
...
@@ -411,9 +411,9 @@ class YouTubeVideoTest(VideoBaseTest):
And the Download Transcript menu does not exist for Video C
"""
data_a
=
{
'sub'
:
'
OEoXaMPEzfM
'
,
'download_track'
:
True
}
data_a
=
{
'sub'
:
'
3_yD_cEKoCk
'
,
'download_track'
:
True
}
youtube_a_metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data_a
)
self
.
assets
.
append
(
'subs_
OEoXaMPEzfM
.srt.sjson'
)
self
.
assets
.
append
(
'subs_
3_yD_cEKoCk
.srt.sjson'
)
data_b
=
{
'youtube_id_1_0'
:
'b7xgknqkQk8'
,
'sub'
:
'b7xgknqkQk8'
,
'download_track'
:
True
}
youtube_b_metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data_b
)
...
...
@@ -431,14 +431,14 @@ class YouTubeVideoTest(VideoBaseTest):
# open the section with videos (open video "A")
self
.
navigate_to_video
()
# check if we can download transcript in "srt" format that has text "00:00:00,2
7
0"
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
'00:00:00,2
7
0'
))
# check if we can download transcript in "srt" format that has text "00:00:00,2
6
0"
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
'00:00:00,2
6
0'
))
# select the transcript format "txt"
self
.
assertTrue
(
self
.
video
.
select_transcript_format
(
'txt'
))
# check if we can download transcript in "txt" format that has text "
Hi, welcome to Edx
."
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'txt'
,
'
Hi, welcome to Edx
.'
))
# check if we can download transcript in "txt" format that has text "
Welcome to edX
."
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'txt'
,
'
Welcome to edX
.'
))
# open video "B"
self
.
course_nav
.
go_to_sequential
(
'B'
)
...
...
@@ -469,10 +469,10 @@ class YouTubeVideoTest(VideoBaseTest):
And I select language with code "zh"
Then I see "好 各位同学" text in the captions
And I select language with code "en"
Then I see "
Hi, welcome to Edx
." text in the captions
Then I see "
Welcome to edX
." text in the captions
"""
self
.
assets
.
extend
([
'chinese_transcripts.srt'
,
'subs_
OEoXaMPEzfM
.srt.sjson'
])
data
=
{
'transcripts'
:
{
"zh"
:
"chinese_transcripts.srt"
},
'sub'
:
'
OEoXaMPEzfM
'
}
self
.
assets
.
extend
([
'chinese_transcripts.srt'
,
'subs_
3_yD_cEKoCk
.srt.sjson'
])
data
=
{
'transcripts'
:
{
"zh"
:
"chinese_transcripts.srt"
},
'sub'
:
'
3_yD_cEKoCk
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
# go to video
...
...
@@ -489,7 +489,7 @@ class YouTubeVideoTest(VideoBaseTest):
self
.
_verify_caption_text
(
unicode_text
)
self
.
video
.
select_language
(
'en'
)
self
.
_verify_caption_text
(
'
Hi, welcome to Edx
.'
)
self
.
_verify_caption_text
(
'
Welcome to edX
.'
)
def
test_multiple_videos_in_sequentials_load_and_work
(
self
):
"""
...
...
@@ -592,15 +592,15 @@ class YouTubeVideoTest(VideoBaseTest):
Given it has a video in "Youtube" mode
And I have uploaded multiple transcripts
And I make sure captions are opened
Then I see "
Hi, welcome to Edx
." text in the captions
Then I see "
Welcome to edX
." text in the captions
And I select the "1.50" speed
And I reload the page with video
Then I see "
Hi, welcome to Edx
." text in the captions
Then I see "
Welcome to edX
." text in the captions
And I see duration "1:56"
"""
self
.
assets
.
extend
([
'subs_
OEoXaMPEzfM
.srt.sjson'
,
'subs_b7xgknqkQk8.srt.sjson'
])
data
=
{
'sub'
:
'
OEoXaMPEzfM
'
,
'youtube_id_1_5'
:
'b7xgknqkQk8'
}
self
.
assets
.
extend
([
'subs_
3_yD_cEKoCk
.srt.sjson'
,
'subs_b7xgknqkQk8.srt.sjson'
])
data
=
{
'sub'
:
'
3_yD_cEKoCk
'
,
'youtube_id_1_5'
:
'b7xgknqkQk8'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
# go to video
...
...
@@ -608,13 +608,13 @@ class YouTubeVideoTest(VideoBaseTest):
self
.
video
.
show_captions
()
self
.
assertIn
(
'
Hi, welcome to Edx
.'
,
self
.
video
.
captions_text
)
self
.
assertIn
(
'
Welcome to edX
.'
,
self
.
video
.
captions_text
)
self
.
video
.
speed
=
'1.50'
self
.
video
.
reload_page
()
self
.
assertIn
(
'
Hi, welcome to Edx
.'
,
self
.
video
.
captions_text
)
self
.
assertIn
(
'
Welcome to edX
.'
,
self
.
video
.
captions_text
)
self
.
assertTrue
(
self
.
video
.
duration
,
'1.56'
)
...
...
@@ -773,18 +773,18 @@ class Html5VideoTest(VideoBaseTest):
And I see the correct non-english text in the captions
And the non-english transcript downloads correctly
"""
self
.
assets
.
extend
([
'chinese_transcripts.srt'
,
'subs_
OEoXaMPEzfM
.srt.sjson'
])
data
=
{
'download_track'
:
True
,
'transcripts'
:
{
'zh'
:
'chinese_transcripts.srt'
},
'sub'
:
'
OEoXaMPEzfM
'
}
self
.
assets
.
extend
([
'chinese_transcripts.srt'
,
'subs_
3_yD_cEKoCk
.srt.sjson'
])
data
=
{
'download_track'
:
True
,
'transcripts'
:
{
'zh'
:
'chinese_transcripts.srt'
},
'sub'
:
'
3_yD_cEKoCk
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'html5'
,
additional_data
=
data
)
# go to video
self
.
navigate_to_video
()
# check if "
Hi, welcome to Edx
." text in the captions
self
.
assertIn
(
'
Hi, welcome to Edx
.'
,
self
.
video
.
captions_text
)
# check if "
Welcome to edX
." text in the captions
self
.
assertIn
(
'
Welcome to edX
.'
,
self
.
video
.
captions_text
)
# check if we can download transcript in "srt" format that has text "
Hi, welcome to Edx
."
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
'
Hi, welcome to Edx
.'
))
# check if we can download transcript in "srt" format that has text "
Welcome to edX
."
self
.
assertTrue
(
self
.
video
.
downloaded_transcript_contains_text
(
'srt'
,
'
Welcome to edX
.'
))
# select language with code "zh"
self
.
assertTrue
(
self
.
video
.
select_language
(
'zh'
))
...
...
@@ -808,8 +808,8 @@ class Html5VideoTest(VideoBaseTest):
And I view the video at fullscreen
Then the video with the transcript enabled is aligned correctly
"""
self
.
assets
.
append
(
'subs_
OEoXaMPEzfM
.srt.sjson'
)
data
=
{
'sub'
:
'
OEoXaMPEzfM
'
}
self
.
assets
.
append
(
'subs_
3_yD_cEKoCk
.srt.sjson'
)
data
=
{
'sub'
:
'
3_yD_cEKoCk
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'html5'
,
additional_data
=
data
)
# go to video
...
...
@@ -832,8 +832,8 @@ class Html5VideoTest(VideoBaseTest):
And I have uploaded an english transcript file to assets
Then I see the correct text in the captions
"""
self
.
assets
.
append
(
'subs_
OEoXaMPEzfM
.srt.sjson'
)
data
=
{
'sub'
:
'
OEoXaMPEzfM
'
}
self
.
assets
.
append
(
'subs_
3_yD_cEKoCk
.srt.sjson'
)
data
=
{
'sub'
:
'
3_yD_cEKoCk
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'html5'
,
additional_data
=
data
)
# go to video
...
...
@@ -842,8 +842,8 @@ class Html5VideoTest(VideoBaseTest):
# make sure captions are opened
self
.
video
.
show_captions
()
# check if we see "
Hi, welcome to Edx
." text in the captions
self
.
assertIn
(
"
Hi, welcome to Edx
."
,
self
.
video
.
captions_text
)
# check if we see "
Welcome to edX
." text in the captions
self
.
assertIn
(
"
Welcome to edX
."
,
self
.
video
.
captions_text
)
def
test_cc_button_wo_english_transcript
(
self
):
"""
...
...
common/test/acceptance/tests/video/test_video_times.py
View file @
d02d3b79
...
...
@@ -111,22 +111,15 @@ class VideoTimesTest(VideoBaseTest):
def
test_video_end_time_and_finish_time
(
self
):
"""
Scenario: Youtube video works after pausing at end time and then plays again from End Time to the end.
Given we have a video in "Youtube" mode with start time set to 00:0
1:41 and end_time set to 00:01:42
Given we have a video in "Youtube" mode with start time set to 00:0
2:14 and end_time set to 00:02:15
And I click video button "play"
And I wait until video stop playing
Then I see video slider at "
1:42
" position
Then I see video slider at "
2:15
" position
And I click video button "play"
And I wait until video stop playing
Then I see video slider at "1:54" position
# NOTE: The above video duration(1:54) is disputed because
# 1. Our Video Player first shows Video Duration equals to 1 minute and 56 sec and then 1 minute and 54 sec
# 2 YouTube first shows duration of 1 minute and 56 seconds and then changes duration to 1 minute and 55 sec
#
# The 1:56 time is the duration from metadata. 1:54 time is the duration reported by the video API once
# the video starts playing. BUT sometime video API gives duration equals 1 minute and 55 second.
Then I see video slider at "2:20" position
"""
data
=
{
'start_time'
:
'00:0
1:41'
,
'end_time'
:
'00:01:42
'
}
data
=
{
'start_time'
:
'00:0
2:14'
,
'end_time'
:
'00:02:15
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
# go to video
...
...
@@ -137,14 +130,14 @@ class VideoTimesTest(VideoBaseTest):
# wait until video stop playing
self
.
video
.
wait_for_state
(
'pause'
)
self
.
assertEqual
(
self
.
video
.
position
,
'
1:42
'
)
self
.
assertEqual
(
self
.
video
.
position
,
'
2:15
'
)
self
.
video
.
click_player_button
(
'play'
)
# wait until video stop playing
self
.
video
.
wait_for_state
(
'finished'
)
self
.
assert
In
(
self
.
video
.
position
,
[
'1:54'
,
'1:55'
]
)
self
.
assert
Equal
(
self
.
video
.
position
,
'2:20'
)
def
test_video_end_time_with_seek
(
self
):
"""
...
...
@@ -174,18 +167,11 @@ class VideoTimesTest(VideoBaseTest):
def
test_video_finish_time_with_seek
(
self
):
"""
Scenario: Finish Time works for Youtube video.
Given it has a video in "Youtube" mode with end-time at 1:00, the video starts playing from
1:42
And I seek video to "
1:42
" position
Given it has a video in "Youtube" mode with end-time at 1:00, the video starts playing from
2:15
And I seek video to "
2:15
" position
And I click video button "play"
And I wait until video stop playing
Then I see video slider at "1:54" position
# NOTE: The above video duration(1:54) is disputed because
# 1. Our Video Player first shows Video Duration equals to 1 minute and 56 sec and then 1 minute and 54 sec
# 2 YouTube first shows duration of 1 minute and 56 seconds and then changes duration to 1 minute and 55 sec
#
# The 1:56 time is the duration from metadata. 1:54 time is the duration reported by the video API once
# the video starts playing. BUT sometime video API gives duration equals 1 minute and 55 second.
Then I see video slider at "2:20" position
"""
data
=
{
'end_time'
:
'00:01:00'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
...
...
@@ -193,11 +179,11 @@ class VideoTimesTest(VideoBaseTest):
# go to video
self
.
navigate_to_video
()
self
.
video
.
seek
(
'
1:42
'
)
self
.
video
.
seek
(
'
2:15
'
)
self
.
video
.
click_player_button
(
'play'
)
# wait until video stop playing
self
.
video
.
wait_for_state
(
'finished'
)
self
.
assert
In
(
self
.
video
.
position
,
[
'1:54'
,
'1:55'
]
)
self
.
assert
Equal
(
self
.
video
.
position
,
'2:20'
)
common/test/data/uploads/subs_3_yD_cEKoCk.srt.sjson
0 → 100644
View file @
d02d3b79
{
"start": [
0,
260,
1510,
4480,
7430,
8400,
11120,
14290,
16650,
20790,
23550,
26190,
31470,
32467,
34050,
37400,
42060,
42910,
45649,
47690,
51560,
53990,
58510,
60870,
61860,
65150,
66570,
68570,
71506,
72509,
75550,
78680,
82030,
84080,
86630,
89786,
91660,
93659,
95570,
98490,
100235,
102970,
105660,
107940,
110790,
113902,
116610,
118310,
121920,
125300,
129889,
133350,
136690
],
"end": [
260,
1510,
4480,
7430,
8400,
11120,
14290,
16650,
20790,
23550,
26190,
31470,
32467,
34050,
37400,
42060,
42910,
45649,
47690,
51560,
53990,
58510,
60870,
61860,
65150,
66570,
68570,
71506,
72509,
75550,
78680,
82030,
84080,
86630,
89786,
91660,
93659,
95570,
98490,
100235,
102970,
105660,
107940,
110790,
113902,
116610,
118310,
121920,
125300,
129889,
133350,
136690,
140907
],
"text": [
"",
"Welcome to edX.",
"I'm Anant Agarwal, I'm the president of edX,",
"I'm also a professor of electrical engineering and computer science",
"at MIT.",
"Online learning is revolutionizing the world.",
"Education will never be the same again, and edX",
"is at the cutting edge of this revolution,",
"so when you take edX courses online, you are part of this evolution.",
"Online learning is the ultimate democratizer.",
"When you learn on edX, you're joining a community.",
"Imagine taking a class with 100,000 or more students-- this social,",
"this is a lot of fun.",
"I think you will enjoy the experience.",
"At edX it's about people, it's not about profit.",
"For you, edX is about the best courses from the best schools and the best",
"professors.",
"Becoming a member of edX is easy.",
"SPEAKER 2: We're really excited to have you here.",
"We're going to get you started-- quick, three easy steps, browse,",
"choose, and have some fun.",
"Registration takes seconds, and once you register just browse the courses.",
"When you find something that you like, click it.",
"It's that easy.",
"Choose wisely, you're selecting courses from the best schools",
"all around the world.",
"Make sure to check the prerequisites.",
"Now you can choose your course and you're on your way.",
"Welcome to the club.",
"SPEAKER 3: Now that you've signed up for course, you can view courseware.",
"The courseware is made up of great videos, automated feedback,",
"and cool interactive features, all for self-paced learning.",
"The interactives are designed to help you",
"explore your understanding of key concepts.",
"A big part of edX is getting instant feedback on your answers,",
"frequently in the form of a green check mark.",
"In a lot of questions, you can try as many times",
"as you need to get that right answer.",
"Courses can be tough, we make sure that they're rigorous,",
"but they can also be a lot of fun.",
"A big part of edX is the social aspect.",
"You can be a social as you want on the discussion boards.",
"In our forums, there's an active community.",
"It's not just the professors, students help each other out.",
"A typical course can run a semester length, or about 12 weeks.",
"At the end of that course, if you've met the course requirements,",
"you can get a certificate of mastery.",
"Once you've completed the course, you're part of our group of lifelong learners.",
"EdX's mission is to help you get a quality education.",
"EdX will increase access to learning for students such as yourself worldwide.",
"This is fun, this is exciting, and this is revolutionary.",
"Welcome to edX, come join us.",
""
]
}
lms/djangoapps/courseware/features/video.feature
View file @
d02d3b79
...
...
@@ -6,12 +6,12 @@ Feature: LMS.Video component
Scenario
:
Verify that each video in each sub-section includes a transcript for non-Youtube countries
Given
youtube server is up and response time is 2 seconds
And
I am registered for the course
"test_course"
And
I have a
"subs_
OEoXaMPEzfM
.srt.sjson"
transcript file in assets
And
I have a
"subs_
3_yD_cEKoCk
.srt.sjson"
transcript file in assets
And
I have a
"subs_b7xgknqkQk8.srt.sjson"
transcript file in assets
And
I have a
"chinese_transcripts.srt"
transcript file in assets
And it has videos "A, B" in "Youtube_HTML5" mode in position "1" of sequential
:
|
sub
|
|
OEoXaMPEzfM
|
|
3_yD_cEKoCk
|
|
b7xgknqkQk8
|
And a video "C" in "Youtube_HTML5" mode in position "2" of sequential
:
|
transcripts
|
...
...
@@ -20,9 +20,9 @@ Feature: LMS.Video component
And
I open the section with videos
Then
videos have rendered in
"HTML5"
mode
And I see text in the captions
:
|
text
|
|
Hi,
welcome
to
Edx.
|
|
Equal
transcripts
|
|
text
|
|
Welcome
to
edX.
|
|
Equal
transcripts
|
When
I open video
"C"
Then
the video has rendered in
"HTML5"
mode
And
I make sure captions are opened
...
...
lms/djangoapps/courseware/tests/test_video_mongo.py
View file @
d02d3b79
...
...
@@ -118,7 +118,7 @@ class TestVideoNonYouTube(TestVideo):
'saved_video_position'
:
0.0
,
'sub'
:
u'a_sub_file.srt.sjson'
,
'track'
:
None
,
'youtube_streams'
:
'1.00:
OEoXaMPEzfM
'
,
'youtube_streams'
:
'1.00:
3_yD_cEKoCk
'
,
'autoplay'
:
settings
.
FEATURES
.
get
(
'AUTOPLAY_VIDEOS'
,
True
),
'yt_test_timeout'
:
1500
,
'yt_api_url'
:
'www.youtube.com/iframe_api'
,
...
...
@@ -222,7 +222,7 @@ class TestGetHtmlMethod(BaseTestXmodule):
'speed'
:
'null'
,
'general_speed'
:
1.0
,
'track'
:
u'http://www.example.com/track'
,
'youtube_streams'
:
'1.00:
OEoXaMPEzfM
'
,
'youtube_streams'
:
'1.00:
3_yD_cEKoCk
'
,
'autoplay'
:
settings
.
FEATURES
.
get
(
'AUTOPLAY_VIDEOS'
,
True
),
'yt_test_timeout'
:
1500
,
'yt_api_url'
:
'www.youtube.com/iframe_api'
,
...
...
@@ -339,7 +339,7 @@ class TestGetHtmlMethod(BaseTestXmodule):
'saved_video_position'
:
0.0
,
'sub'
:
u'a_sub_file.srt.sjson'
,
'track'
:
None
,
'youtube_streams'
:
'1.00:
OEoXaMPEzfM
'
,
'youtube_streams'
:
'1.00:
3_yD_cEKoCk
'
,
'autoplay'
:
settings
.
FEATURES
.
get
(
'AUTOPLAY_VIDEOS'
,
True
),
'yt_test_timeout'
:
1500
,
'yt_api_url'
:
'www.youtube.com/iframe_api'
,
...
...
@@ -479,7 +479,7 @@ class TestGetHtmlMethod(BaseTestXmodule):
'saved_video_position'
:
0.0
,
'sub'
:
u'a_sub_file.srt.sjson'
,
'track'
:
None
,
'youtube_streams'
:
'1.00:
OEoXaMPEzfM
'
,
'youtube_streams'
:
'1.00:
3_yD_cEKoCk
'
,
'autoplay'
:
settings
.
FEATURES
.
get
(
'AUTOPLAY_VIDEOS'
,
True
),
'yt_test_timeout'
:
1500
,
'yt_api_url'
:
'www.youtube.com/iframe_api'
,
...
...
@@ -597,7 +597,7 @@ class TestGetHtmlMethod(BaseTestXmodule):
'saved_video_position'
:
0.0
,
'sub'
:
u'a_sub_file.srt.sjson'
,
'track'
:
None
,
'youtube_streams'
:
'1.00:
OEoXaMPEzfM
'
,
'youtube_streams'
:
'1.00:
3_yD_cEKoCk
'
,
'autoplay'
:
settings
.
FEATURES
.
get
(
'AUTOPLAY_VIDEOS'
,
True
),
'yt_test_timeout'
:
1500
,
'yt_api_url'
:
'www.youtube.com/iframe_api'
,
...
...
@@ -716,7 +716,7 @@ class TestGetHtmlMethod(BaseTestXmodule):
'saved_video_position'
:
0.0
,
'sub'
:
u'a_sub_file.srt.sjson'
,
'track'
:
None
,
'youtube_streams'
:
'1.00:
OEoXaMPEzfM
'
,
'youtube_streams'
:
'1.00:
3_yD_cEKoCk
'
,
'autoplay'
:
settings
.
FEATURES
.
get
(
'AUTOPLAY_VIDEOS'
,
True
),
'yt_test_timeout'
:
1500
,
'yt_api_url'
:
'www.youtube.com/iframe_api'
,
...
...
@@ -773,7 +773,7 @@ class TestVideoDescriptorInitialization(BaseTestXmodule):
def
test_source_not_in_html5sources
(
self
):
metadata
=
{
'source'
:
'http://example.org/video.mp4'
,
'html5_sources'
:
[
'http://youtu.be/
OEoXaMPEzfM
.mp4'
],
'html5_sources'
:
[
'http://youtu.be/
3_yD_cEKoCk
.mp4'
],
}
self
.
initialize_module
(
metadata
=
metadata
)
...
...
@@ -821,7 +821,7 @@ class TestVideoDescriptorInitialization(BaseTestXmodule):
'display_name'
:
'Video Sources'
,
'help'
:
'A list of filenames to be used with HTML5 video.'
,
'type'
:
'List'
,
'value'
:
[
u'http://youtu.be/
OEoXaMPEzfM
.mp4'
],
'value'
:
[
u'http://youtu.be/
3_yD_cEKoCk
.mp4'
],
'field_name'
:
'html5_sources'
,
'options'
:
[],
},
...
...
@@ -862,7 +862,7 @@ class TestVideoDescriptorInitialization(BaseTestXmodule):
metadata
=
{
'track'
:
u'http://some_track.srt'
,
'source'
:
'http://example.org/video.mp4'
,
'html5_sources'
:
[
'http://youtu.be/
OEoXaMPEzfM
.mp4'
],
'html5_sources'
:
[
'http://youtu.be/
3_yD_cEKoCk
.mp4'
],
}
self
.
initialize_module
(
metadata
=
metadata
)
...
...
@@ -877,7 +877,7 @@ class TestVideoDescriptorInitialization(BaseTestXmodule):
def
test_source_is_empty
(
self
):
metadata
=
{
'source'
:
''
,
'html5_sources'
:
[
'http://youtu.be/
OEoXaMPEzfM
.mp4'
],
'html5_sources'
:
[
'http://youtu.be/
3_yD_cEKoCk
.mp4'
],
}
self
.
initialize_module
(
metadata
=
metadata
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment