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
f0754175
Commit
f0754175
authored
Jul 24, 2015
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9049 from edx/sarina/cypress-ytapi-upgrade
Sarina/cypress ytapi upgrade
parents
82f937b9
1680cf25
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
124 additions
and
74 deletions
+124
-74
cms/envs/acceptance.py
+2
-2
cms/envs/aws.py
+1
-0
cms/envs/bok_choy.py
+2
-2
cms/envs/common.py
+7
-4
cms/templates/ux/reference/container.html
+1
-1
common/djangoapps/terrain/setup_prereqs.py
+1
-2
common/djangoapps/terrain/stubs/youtube.py
+12
-10
common/lib/xmodule/xmodule/js/fixtures/video.html
+1
-1
common/lib/xmodule/xmodule/js/fixtures/video_all.html
+1
-1
common/lib/xmodule/xmodule/js/fixtures/video_html5.html
+1
-1
common/lib/xmodule/xmodule/js/fixtures/video_no_captions.html
+1
-1
common/lib/xmodule/xmodule/js/fixtures/video_with_bumper.html
+1
-1
common/lib/xmodule/xmodule/js/fixtures/video_yt_multiple.html
+3
-3
common/lib/xmodule/xmodule/js/js_test.yml
+1
-0
common/lib/xmodule/xmodule/js/spec/helper.js
+31
-19
common/lib/xmodule/xmodule/js/spec/video/general_spec.js
+6
-0
common/lib/xmodule/xmodule/js/spec/video/initialize_spec.js
+2
-2
common/lib/xmodule/xmodule/js/src/video/01_initialize.js
+0
-0
common/lib/xmodule/xmodule/js/src/video/10_main.js
+2
-0
common/lib/xmodule/xmodule/tests/test_video.py
+2
-2
common/lib/xmodule/xmodule/video_module/video_module.py
+13
-1
common/test/acceptance/tests/helpers.py
+1
-2
common/test/acceptance/tests/video/test_video_events.py
+4
-0
common/test/acceptance/tests/video/test_video_module.py
+2
-0
lms/djangoapps/courseware/features/video.feature
+4
-4
lms/djangoapps/courseware/tests/test_video_mongo.py
+12
-8
lms/envs/acceptance.py
+2
-2
lms/envs/aws.py
+1
-0
lms/envs/bok_choy.py
+2
-2
lms/envs/common.py
+4
-3
lms/static/js_test.yml
+1
-0
No files found.
cms/envs/acceptance.py
View file @
f0754175
...
@@ -118,8 +118,8 @@ except ImportError:
...
@@ -118,8 +118,8 @@ except ImportError:
pass
pass
# Point the URL used to test YouTube availability to our stub YouTube server
# Point the URL used to test YouTube availability to our stub YouTube server
YOUTUBE
[
'API'
]
=
"127.0.0.1:{0}/get_youtube_api/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'API'
]
=
"
http://
127.0.0.1:{0}/get_youtube_api/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'
TEST_URL'
]
=
"
127.0.0.1:{0}/test_youtube/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'
METADATA_URL'
]
=
"http://
127.0.0.1:{0}/test_youtube/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'TEXT_API'
][
'url'
]
=
"127.0.0.1:{0}/test_transcripts_youtube/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'TEXT_API'
][
'url'
]
=
"127.0.0.1:{0}/test_transcripts_youtube/"
.
format
(
YOUTUBE_PORT
)
# Generate a random UUID so that different runs of acceptance tests don't break each other
# Generate a random UUID so that different runs of acceptance tests don't break each other
...
...
cms/envs/aws.py
View file @
f0754175
...
@@ -348,3 +348,4 @@ if FEATURES['ENABLE_COURSEWARE_INDEX'] or FEATURES['ENABLE_LIBRARY_INDEX']:
...
@@ -348,3 +348,4 @@ if FEATURES['ENABLE_COURSEWARE_INDEX'] or FEATURES['ENABLE_LIBRARY_INDEX']:
XBLOCK_SETTINGS
=
ENV_TOKENS
.
get
(
'XBLOCK_SETTINGS'
,
{})
XBLOCK_SETTINGS
=
ENV_TOKENS
.
get
(
'XBLOCK_SETTINGS'
,
{})
XBLOCK_SETTINGS
.
setdefault
(
"VideoDescriptor"
,
{})[
"licensing_enabled"
]
=
FEATURES
.
get
(
"LICENSING"
,
False
)
XBLOCK_SETTINGS
.
setdefault
(
"VideoDescriptor"
,
{})[
"licensing_enabled"
]
=
FEATURES
.
get
(
"LICENSING"
,
False
)
XBLOCK_SETTINGS
.
setdefault
(
"VideoModule"
,
{})[
'YOUTUBE_API_KEY'
]
=
AUTH_TOKENS
.
get
(
'YOUTUBE_API_KEY'
,
YOUTUBE_API_KEY
)
cms/envs/bok_choy.py
View file @
f0754175
...
@@ -103,8 +103,8 @@ FEATURES['ENTRANCE_EXAMS'] = True
...
@@ -103,8 +103,8 @@ FEATURES['ENTRANCE_EXAMS'] = True
# Point the URL used to test YouTube availability to our stub YouTube server
# Point the URL used to test YouTube availability to our stub YouTube server
YOUTUBE_PORT
=
9080
YOUTUBE_PORT
=
9080
YOUTUBE
[
'API'
]
=
"127.0.0.1:{0}/get_youtube_api/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'API'
]
=
"
http://
127.0.0.1:{0}/get_youtube_api/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'
TEST_URL'
]
=
"
127.0.0.1:{0}/test_youtube/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'
METADATA_URL'
]
=
"http://
127.0.0.1:{0}/test_youtube/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'TEXT_API'
][
'url'
]
=
"127.0.0.1:{0}/test_transcripts_youtube/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'TEXT_API'
][
'url'
]
=
"127.0.0.1:{0}/test_transcripts_youtube/"
.
format
(
YOUTUBE_PORT
)
FEATURES
[
'ENABLE_COURSEWARE_INDEX'
]
=
True
FEATURES
[
'ENABLE_COURSEWARE_INDEX'
]
=
True
...
...
cms/envs/common.py
View file @
f0754175
...
@@ -44,7 +44,7 @@ from lms.envs.common import (
...
@@ -44,7 +44,7 @@ from lms.envs.common import (
PROFILE_IMAGE_SECRET_KEY
,
PROFILE_IMAGE_MIN_BYTES
,
PROFILE_IMAGE_MAX_BYTES
,
PROFILE_IMAGE_SECRET_KEY
,
PROFILE_IMAGE_MIN_BYTES
,
PROFILE_IMAGE_MAX_BYTES
,
# The following setting is included as it is used to check whether to
# The following setting is included as it is used to check whether to
# display credit eligibility table on the CMS or not.
# display credit eligibility table on the CMS or not.
ENABLE_CREDIT_ELIGIBILITY
ENABLE_CREDIT_ELIGIBILITY
,
YOUTUBE_API_KEY
)
)
from
path
import
path
from
path
import
path
from
warnings
import
simplefilter
from
warnings
import
simplefilter
...
@@ -652,10 +652,10 @@ CELERY_QUEUES = {
...
@@ -652,10 +652,10 @@ CELERY_QUEUES = {
YOUTUBE
=
{
YOUTUBE
=
{
# YouTube JavaScript API
# YouTube JavaScript API
'API'
:
'www.youtube.com/iframe_api'
,
'API'
:
'
https://
www.youtube.com/iframe_api'
,
# URL to
test YouTube availability
# URL to
get YouTube metadata
'
TEST_URL'
:
'gdata.youtube.com/feeds/api/videos/
'
,
'
METADATA_URL'
:
'https://www.googleapis.com/youtube/v3/videos
'
,
# Current youtube api for requesting transcripts.
# Current youtube api for requesting transcripts.
# For example: http://video.google.com/timedtext?lang=en&v=j_jEn79vS3g.
# For example: http://video.google.com/timedtext?lang=en&v=j_jEn79vS3g.
...
@@ -994,6 +994,9 @@ ELASTIC_FIELD_MAPPINGS = {
...
@@ -994,6 +994,9 @@ ELASTIC_FIELD_MAPPINGS = {
XBLOCK_SETTINGS
=
{
XBLOCK_SETTINGS
=
{
"VideoDescriptor"
:
{
"VideoDescriptor"
:
{
"licensing_enabled"
:
FEATURES
.
get
(
"LICENSING"
,
False
)
"licensing_enabled"
:
FEATURES
.
get
(
"LICENSING"
,
False
)
},
'VideoModule'
:
{
'YOUTUBE_API_KEY'
:
YOUTUBE_API_KEY
}
}
}
}
...
...
cms/templates/ux/reference/container.html
View file @
f0754175
...
@@ -137,7 +137,7 @@
...
@@ -137,7 +137,7 @@
<h2>
Video
</h2>
<h2>
Video
</h2>
<div
id=
"video_i4x-AndyA-ABT101-video-72b5a0d74e8c4ed4a4d4e6bf67837c09"
class=
"video closed is-initialized"
data-streams=
"1.00:OEoXaMPEzfM"
data-save-state-url=
"/preview/xblock/i4x:;_;_AndyA;_ABT101;_video;_72b5a0d74e8c4ed4a4d4e6bf67837c09/handler/xmodule_handler/save_user_state"
data-caption-data-dir=
"None"
data-show-captions=
"true"
data-general-speed=
"1.0"
data-speed=
"null"
data-start=
"0.0"
data-end=
"0.0"
data-caption-asset-path=
"/c4x/AndyA/ABT101/asset/subs_"
data-autoplay=
"False"
data-yt-test-timeout=
"1500"
data-yt-test-url=
"https://
gdata.youtube.com/feeds/api
/videos/"
data-autohide-html5=
"False"
tabindex=
"-1"
>
<div
id=
"video_i4x-AndyA-ABT101-video-72b5a0d74e8c4ed4a4d4e6bf67837c09"
class=
"video closed is-initialized"
data-streams=
"1.00:OEoXaMPEzfM"
data-save-state-url=
"/preview/xblock/i4x:;_;_AndyA;_ABT101;_video;_72b5a0d74e8c4ed4a4d4e6bf67837c09/handler/xmodule_handler/save_user_state"
data-caption-data-dir=
"None"
data-show-captions=
"true"
data-general-speed=
"1.0"
data-speed=
"null"
data-start=
"0.0"
data-end=
"0.0"
data-caption-asset-path=
"/c4x/AndyA/ABT101/asset/subs_"
data-autoplay=
"False"
data-yt-test-timeout=
"1500"
data-yt-test-url=
"https://
www.googleapis.com/youtube/v3
/videos/"
data-autohide-html5=
"False"
tabindex=
"-1"
>
<div
class=
"focus_grabber first"
tabindex=
"-1"
></div>
<div
class=
"focus_grabber first"
tabindex=
"-1"
></div>
<div
class=
"tc-wrapper"
>
<div
class=
"tc-wrapper"
>
...
...
common/djangoapps/terrain/setup_prereqs.py
View file @
f0754175
...
@@ -28,8 +28,7 @@ SERVICES = {
...
@@ -28,8 +28,7 @@ SERVICES = {
YOUTUBE_API_URLS
=
{
YOUTUBE_API_URLS
=
{
'main'
:
'https://www.youtube.com/'
,
'main'
:
'https://www.youtube.com/'
,
'player'
:
'http://www.youtube.com/iframe_api'
,
'player'
:
'https://www.youtube.com/iframe_api'
,
'metadata'
:
'http://gdata.youtube.com/feeds/api/videos/'
,
# For transcripts, you need to check an actual video, so we will
# For transcripts, you need to check an actual video, so we will
# just specify our default video and see if that one is available.
# 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=OEoXaMPEzfM'
,
...
...
common/djangoapps/terrain/stubs/youtube.py
View file @
f0754175
...
@@ -95,6 +95,9 @@ class StubYouTubeHandler(StubHttpRequestHandler):
...
@@ -95,6 +95,9 @@ class StubYouTubeHandler(StubHttpRequestHandler):
if
self
.
server
.
config
.
get
(
'youtube_api_blocked'
):
if
self
.
server
.
config
.
get
(
'youtube_api_blocked'
):
self
.
send_response
(
404
,
content
=
''
,
headers
=
{
'Content-type'
:
'text/plain'
})
self
.
send_response
(
404
,
content
=
''
,
headers
=
{
'Content-type'
:
'text/plain'
})
else
:
else
:
# Delay the response to simulate network latency
time
.
sleep
(
self
.
server
.
config
.
get
(
'time_to_response'
,
self
.
DEFAULT_DELAY_SEC
))
# Get the response to send from YouTube.
# Get the response to send from YouTube.
# We need to do this every time because Google sometimes sends different responses
# We need to do this every time because Google sometimes sends different responses
# as part of their own experiments, which has caused our tests to become "flaky"
# as part of their own experiments, which has caused our tests to become "flaky"
...
@@ -117,17 +120,16 @@ class StubYouTubeHandler(StubHttpRequestHandler):
...
@@ -117,17 +120,16 @@ class StubYouTubeHandler(StubHttpRequestHandler):
# Construct the response content
# Construct the response content
callback
=
self
.
get_params
[
'callback'
]
callback
=
self
.
get_params
[
'callback'
]
youtube_metadata
=
json
.
loads
(
requests
.
get
(
"http://gdata.youtube.com/feeds/api/videos/{id}?v=2&alt=jsonc"
.
format
(
id
=
youtube_id
)
)
.
text
)
data
=
OrderedDict
({
data
=
OrderedDict
({
'data'
:
OrderedDict
({
'items'
:
list
(
'id'
:
youtube_id
,
OrderedDict
({
'message'
:
message
,
'contentDetails'
:
OrderedDict
({
'duration'
:
youtube_metadata
[
'data'
][
'duration'
],
'id'
:
youtube_id
,
})
'duration'
:
'PT2M20S'
,
})
})
)
})
})
response
=
"{cb}({data})"
.
format
(
cb
=
callback
,
data
=
json
.
dumps
(
data
))
response
=
"{cb}({data})"
.
format
(
cb
=
callback
,
data
=
json
.
dumps
(
data
))
...
...
common/lib/xmodule/xmodule/js/fixtures/video.html
View file @
f0754175
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
<div
id=
"video_id"
id=
"video_id"
class=
"video closed"
class=
"video closed"
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": "[]", "speed": "1.5", "startTime": "", "streams": "0.5:7tqY6eQzVhE,1.0:cogebirgzzM,1.5:abcdefghijkl", "sub": "Z5KLxerq05Y", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "yt
TestUrl": "gdata.youtube.com/feeds/api
/videos/"}'
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": "[]", "speed": "1.5", "startTime": "", "streams": "0.5:7tqY6eQzVhE,1.0:cogebirgzzM,1.5:abcdefghijkl", "sub": "Z5KLxerq05Y", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "yt
MetadataUrl": "www.googleapis.com/youtube/v3
/videos/"}'
>
>
<div
class=
"focus_grabber first"
></div>
<div
class=
"focus_grabber first"
></div>
...
...
common/lib/xmodule/xmodule/js/fixtures/video_all.html
View file @
f0754175
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
<div
id=
"video_id"
id=
"video_id"
class=
"video closed"
class=
"video closed"
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "speed": "1.5", "startTime": "", "streams": "", "sub": "Z5KLxerq05Y", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "yt
TestUrl": "gdata.youtube.com/feeds/api
/videos/"}'
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "speed": "1.5", "startTime": "", "streams": "", "sub": "Z5KLxerq05Y", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "yt
MetadataUrl": "www.googleapis.com/youtube/v3
/videos/"}'
>
>
<div
class=
"focus_grabber first"
></div>
<div
class=
"focus_grabber first"
></div>
...
...
common/lib/xmodule/xmodule/js/fixtures/video_html5.html
View file @
f0754175
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
<div
id=
"video_id"
id=
"video_id"
class=
"video closed"
class=
"video closed"
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "speed": "1.5", "startTime": "", "streams": "", "sub": "Z5KLxerq05Y", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "yt
TestUrl": "gdata.youtube.com/feeds/api
/videos/", "source": "", "html5_sources": ["http://youtu.be/3_yD_cEKoCk.mp4"]}'
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "speed": "1.5", "startTime": "", "streams": "", "sub": "Z5KLxerq05Y", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "yt
MetadataUrl": "www.googleapis.com/youtube/v3
/videos/", "source": "", "html5_sources": ["http://youtu.be/3_yD_cEKoCk.mp4"]}'
>
>
<div
class=
"focus_grabber first"
></div>
<div
class=
"focus_grabber first"
></div>
...
...
common/lib/xmodule/xmodule/js/fixtures/video_no_captions.html
View file @
f0754175
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
<div
id=
"video_id"
id=
"video_id"
class=
"video closed"
class=
"video closed"
data-metadata=
'{"streams":"0.5:7tqY6eQzVhE,1.0:cogebirgzzM,1.5:abcdefghijkl", "showCaptions": false, "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "speed": "1.5", "startTime": "", "end": "", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytTestTimeout": "1500", "yt
TestUrl": "gdata.youtube.com/feeds/api
/videos/"}'
data-metadata=
'{"streams":"0.5:7tqY6eQzVhE,1.0:cogebirgzzM,1.5:abcdefghijkl", "showCaptions": false, "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "speed": "1.5", "startTime": "", "end": "", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytTestTimeout": "1500", "yt
MetadataUrl": "www.googleapis.com/youtube/v3
/videos/"}'
>
>
<div
class=
"focus_grabber first"
></div>
<div
class=
"focus_grabber first"
></div>
...
...
common/lib/xmodule/xmodule/js/fixtures/video_with_bumper.html
View file @
f0754175
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
<div
id=
"video_id"
id=
"video_id"
class=
"video closed"
class=
"video closed"
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "speed": "1.5", "startTime": "", "streams": "", "sub": "Z5KLxerq05Y", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "yt
TestUrl": "gdata.youtube.com/feeds/api
/videos/"}'
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "speed": "1.5", "startTime": "", "streams": "", "sub": "Z5KLxerq05Y", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "yt
MetadataUrl": "www.googleapis.com/youtube/v3
/videos/"}'
data-bumper-metadata=
'{"transcriptLanguage": "en", "showCaptions": "true", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "transcriptTranslationUrl": "/transcript/translation/__lang__/?is_bumper=1", "transcriptAvailableTranslationsUrl": "/transcript/available_translations/?is_bumper=1", "streams": "", "saveStateUrl": "/save_user_state"}'
data-bumper-metadata=
'{"transcriptLanguage": "en", "showCaptions": "true", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "transcriptTranslationUrl": "/transcript/translation/__lang__/?is_bumper=1", "transcriptAvailableTranslationsUrl": "/transcript/available_translations/?is_bumper=1", "streams": "", "saveStateUrl": "/save_user_state"}'
data-poster=
'{"url": "xmodule/include/fixtures/poster.jpg", "type": "youtube"}'
data-poster=
'{"url": "xmodule/include/fixtures/poster.jpg", "type": "youtube"}'
>
>
...
...
common/lib/xmodule/xmodule/js/fixtures/video_yt_multiple.html
View file @
f0754175
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
<div
id=
"video_id1"
id=
"video_id1"
class=
"video closed"
class=
"video closed"
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "speed": "1.5", "startTime": "", "streams": "0.5:7tqY6eQzVhE,1.0:cogebirgzzM,1.5:abcdefghijkl", "sub": "", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "yt
TestUrl": "gdata.youtube.com/feeds/api
/videos/"}'
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "speed": "1.5", "startTime": "", "streams": "0.5:7tqY6eQzVhE,1.0:cogebirgzzM,1.5:abcdefghijkl", "sub": "", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "yt
MetadataUrl": "www.googleapis.com/youtube/v3
/videos/"}'
>
>
<div
class=
"focus_grabber first"
></div>
<div
class=
"focus_grabber first"
></div>
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
<div
<div
id=
"video_id2"
id=
"video_id2"
class=
"video"
class=
"video"
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "speed": "1.0", "startTime": "", "streams": "0.75:7tqY6eQzVhE,1.0:cogebirgzzM", "sub": "", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "yt
TestUrl": "gdata.youtube.com/feeds/api
/videos/"}'
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "speed": "1.0", "startTime": "", "streams": "0.75:7tqY6eQzVhE,1.0:cogebirgzzM", "sub": "", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "yt
MetadataUrl": "www.googleapis.com/youtube/v3
/videos/"}'
>
>
<div
class=
"tc-wrapper"
>
<div
class=
"tc-wrapper"
>
<article
class=
"video-wrapper"
>
<article
class=
"video-wrapper"
>
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
<div
<div
id=
"video_id3"
id=
"video_id3"
class=
"video"
class=
"video"
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "speed": "1.0", "startTime": "", "streams": "0.75:7tqY6eQzVhE,1.0:cogebirgzzM", "sub": "", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "yt
TestUrl": "gdata.youtube.com/feeds/api
/videos/"}'
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "speed": "1.0", "startTime": "", "streams": "0.75:7tqY6eQzVhE,1.0:cogebirgzzM", "sub": "", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "yt
MetadataUrl": "www.googleapis.com/youtube/v3
/videos/"}'
>
>
<div
class=
"tc-wrapper"
>
<div
class=
"tc-wrapper"
>
<article
class=
"video-wrapper"
>
<article
class=
"video-wrapper"
>
...
...
common/lib/xmodule/xmodule/js/js_test.yml
View file @
f0754175
...
@@ -59,6 +59,7 @@ lib_paths:
...
@@ -59,6 +59,7 @@ lib_paths:
-
common_static/js/src/utility.js
-
common_static/js/src/utility.js
-
public/js/split_test_staff.js
-
public/js/split_test_staff.js
-
common_static/js/src/accessibility_tools.js
-
common_static/js/src/accessibility_tools.js
-
common_static/js/vendor/moment.min.js
# Paths to spec (test) JavaScript files
# Paths to spec (test) JavaScript files
spec_paths
:
spec_paths
:
...
...
common/lib/xmodule/xmodule/js/spec/helper.js
View file @
f0754175
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
return
f
();
return
f
();
}
}
};
};
jasmine
.
YT
=
stubbedYT
;
// Stub YouTube API.
// Stub YouTube API.
window
.
YT
=
stubbedYT
;
window
.
YT
=
stubbedYT
;
...
@@ -76,19 +76,27 @@
...
@@ -76,19 +76,27 @@
jasmine
.
stubbedMetadata
=
{
jasmine
.
stubbedMetadata
=
{
'7tqY6eQzVhE'
:
{
'7tqY6eQzVhE'
:
{
id
:
'7tqY6eQzVhE'
,
contentDetails
:
{
duration
:
300
id
:
'7tqY6eQzVhE'
,
duration
:
'PT5M0S'
}
},
},
'cogebirgzzM'
:
{
'cogebirgzzM'
:
{
id
:
'cogebirgzzM'
,
contentDetails
:
{
duration
:
200
id
:
'cogebirgzzM'
,
duration
:
'PT3M20S'
}
},
},
'abcdefghijkl'
:
{
'abcdefghijkl'
:
{
id
:
'abcdefghijkl'
,
contentDetails
:
{
duration
:
400
id
:
'abcdefghijkl'
,
duration
:
'PT6M40S'
}
},
},
bogus
:
{
bogus
:
{
duration
:
100
contentDetails
:
{
duration
:
'PT1M40S'
}
}
}
};
};
...
@@ -122,7 +130,7 @@
...
@@ -122,7 +130,7 @@
}
}
return
spy
.
andCallFake
(
function
(
settings
)
{
return
spy
.
andCallFake
(
function
(
settings
)
{
var
match
=
settings
.
url
var
match
=
settings
.
url
.
match
(
/
youtube
\.
com
\/
.+
\/
videos
\/(
.+
)\?
v=2&alt=jsonc
/
),
.
match
(
/
googleapis
\.
com
\/
.+
\/
videos
\/\?
id=
(
.+
)
&part=contentDetails
/
),
status
,
callCallback
;
status
,
callCallback
;
if
(
match
)
{
if
(
match
)
{
status
=
match
[
1
].
split
(
'_'
);
status
=
match
[
1
].
split
(
'_'
);
...
@@ -138,7 +146,7 @@
...
@@ -138,7 +146,7 @@
};
};
}
else
if
(
settings
.
success
)
{
}
else
if
(
settings
.
success
)
{
return
settings
.
success
({
return
settings
.
success
({
data
:
jasmine
.
stubbedMetadata
[
match
[
1
]]
items
:
jasmine
.
stubbedMetadata
[
match
[
1
]]
});
});
}
else
{
}
else
{
return
{
return
{
...
@@ -168,15 +176,6 @@
...
@@ -168,15 +176,6 @@
return
;
return
;
}
else
if
(
settings
.
url
===
'/save_user_state'
)
{
}
else
if
(
settings
.
url
===
'/save_user_state'
)
{
return
{
success
:
true
};
return
{
success
:
true
};
}
else
if
(
settings
.
url
===
'http://www.youtube.com/iframe_api'
)
{
// Stub YouTube API.
window
.
YT
=
stubbedYT
;
// Call the callback that must be called when YouTube API is
// loaded. By specification.
window
.
onYouTubeIframeAPIReady
();
return
{
success
:
true
};
}
else
{
}
else
{
throw
'External request attempted for '
+
throw
'External request attempted for '
+
settings
.
url
+
settings
.
url
+
...
@@ -224,6 +223,19 @@
...
@@ -224,6 +223,19 @@
// Stub jQuery.scrollTo module.
// Stub jQuery.scrollTo module.
$
.
fn
.
scrollTo
=
jasmine
.
createSpy
(
'jQuery.scrollTo'
);
$
.
fn
.
scrollTo
=
jasmine
.
createSpy
(
'jQuery.scrollTo'
);
// Stub window.Video.loadYouTubeIFrameAPI()
window
.
Video
.
loadYouTubeIFrameAPI
=
jasmine
.
createSpy
(
'window.Video.loadYouTubeIFrameAPI'
).
andReturn
(
function
(
scriptTag
)
{
var
event
=
document
.
createEvent
(
'Event'
);
if
(
fixture
===
"video.html"
)
{
event
.
initEvent
(
'load'
,
false
,
false
);
}
else
{
event
.
initEvent
(
'error'
,
false
,
false
);
}
scriptTag
.
dispatchEvent
(
event
);
}
);
jasmine
.
initializePlayer
=
function
(
fixture
,
params
)
{
jasmine
.
initializePlayer
=
function
(
fixture
,
params
)
{
var
state
;
var
state
;
...
...
common/lib/xmodule/xmodule/js/spec/video/general_spec.js
View file @
f0754175
...
@@ -115,6 +115,12 @@
...
@@ -115,6 +115,12 @@
return
state
.
youtubeApiAvailable
===
true
;
return
state
.
youtubeApiAvailable
===
true
;
},
'YouTube API is loaded'
,
3000
);
},
'YouTube API is loaded'
,
3000
);
window
.
YT
=
jasmine
.
YT
;
// Call the callback that must be called when YouTube API is
// loaded. By specification.
window
.
onYouTubeIframeAPIReady
();
runs
(
function
()
{
runs
(
function
()
{
// If YouTube API is not loaded, then the code will should create
// If YouTube API is not loaded, then the code will should create
// a global callback that will be called by API once it is loaded.
// a global callback that will be called by API once it is loaded.
...
...
common/lib/xmodule/xmodule/js/spec/video/initialize_spec.js
View file @
f0754175
...
@@ -71,10 +71,10 @@ function (Initialize) {
...
@@ -71,10 +71,10 @@ function (Initialize) {
speed
:
'1.50'
,
speed
:
'1.50'
,
metadata
:
{
metadata
:
{
'testId'
:
{
'testId'
:
{
duration
:
400
duration
:
'PT6M40S'
},
},
'videoId'
:
{
'videoId'
:
{
duration
:
100
duration
:
'PT1M40S'
}
}
},
},
videos
:
{
videos
:
{
...
...
common/lib/xmodule/xmodule/js/src/video/01_initialize.js
View file @
f0754175
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/js/src/video/10_main.js
View file @
f0754175
...
@@ -160,6 +160,8 @@
...
@@ -160,6 +160,8 @@
youtubeXhr
=
null
;
youtubeXhr
=
null
;
};
};
window
.
Video
.
loadYouTubeIFrameAPI
=
initialize
.
prototype
.
loadYouTubeIFrameAPI
;
// Invoke the mock Video constructor so that the elements stored within it can be processed by the real
// Invoke the mock Video constructor so that the elements stored within it can be processed by the real
// `window.Video` constructor.
// `window.Video` constructor.
oldVideo
(
null
,
true
);
oldVideo
(
null
,
true
);
...
...
common/lib/xmodule/xmodule/tests/test_video.py
View file @
f0754175
...
@@ -736,8 +736,8 @@ class VideoDescriptorIndexingTestCase(unittest.TestCase):
...
@@ -736,8 +736,8 @@ class VideoDescriptorIndexingTestCase(unittest.TestCase):
# YouTube JavaScript API
# YouTube JavaScript API
'API'
:
'www.youtube.com/iframe_api'
,
'API'
:
'www.youtube.com/iframe_api'
,
# URL to
test YouTube availability
# URL to
get YouTube metadata
'
TEST_URL'
:
'gdata.youtube.com/feeds/api
/videos/'
,
'
METADATA_URL'
:
'www.googleapis.com/youtube/v3
/videos/'
,
# Current youtube api for requesting transcripts.
# Current youtube api for requesting transcripts.
# For example: http://video.google.com/timedtext?lang=en&v=j_jEn79vS3g.
# For example: http://video.google.com/timedtext?lang=en&v=j_jEn79vS3g.
...
...
common/lib/xmodule/xmodule/video_module/video_module.py
View file @
f0754175
...
@@ -86,6 +86,7 @@ log = logging.getLogger(__name__)
...
@@ -86,6 +86,7 @@ log = logging.getLogger(__name__)
_
=
lambda
text
:
text
_
=
lambda
text
:
text
@XBlock.wants
(
'settings'
)
class
VideoModule
(
VideoFields
,
VideoTranscriptsMixin
,
VideoStudentViewHandlers
,
XModule
,
LicenseMixin
):
class
VideoModule
(
VideoFields
,
VideoTranscriptsMixin
,
VideoStudentViewHandlers
,
XModule
,
LicenseMixin
):
"""
"""
XML source example:
XML source example:
...
@@ -261,6 +262,15 @@ class VideoModule(VideoFields, VideoTranscriptsMixin, VideoStudentViewHandlers,
...
@@ -261,6 +262,15 @@ class VideoModule(VideoFields, VideoTranscriptsMixin, VideoStudentViewHandlers,
cdn_exp_group
=
None
cdn_exp_group
=
None
self
.
youtube_streams
=
youtube_streams
or
create_youtube_string
(
self
)
# pylint: disable=W0201
self
.
youtube_streams
=
youtube_streams
or
create_youtube_string
(
self
)
# pylint: disable=W0201
settings_service
=
self
.
runtime
.
service
(
self
,
'settings'
)
yt_api_key
=
None
if
settings_service
:
xblock_settings
=
settings_service
.
get_settings_bucket
(
self
)
if
xblock_settings
and
'YOUTUBE_API_KEY'
in
xblock_settings
:
yt_api_key
=
xblock_settings
[
'YOUTUBE_API_KEY'
]
metadata
=
{
metadata
=
{
'saveStateUrl'
:
self
.
system
.
ajax_url
+
'/save_user_state'
,
'saveStateUrl'
:
self
.
system
.
ajax_url
+
'/save_user_state'
,
'autoplay'
:
settings
.
FEATURES
.
get
(
'AUTOPLAY_VIDEOS'
,
False
),
'autoplay'
:
settings
.
FEATURES
.
get
(
'AUTOPLAY_VIDEOS'
,
False
),
...
@@ -286,7 +296,9 @@ class VideoModule(VideoFields, VideoTranscriptsMixin, VideoStudentViewHandlers,
...
@@ -286,7 +296,9 @@ class VideoModule(VideoFields, VideoTranscriptsMixin, VideoStudentViewHandlers,
'ytTestTimeout'
:
1500
,
'ytTestTimeout'
:
1500
,
'ytApiUrl'
:
settings
.
YOUTUBE
[
'API'
],
'ytApiUrl'
:
settings
.
YOUTUBE
[
'API'
],
'ytTestUrl'
:
settings
.
YOUTUBE
[
'TEST_URL'
],
'ytMetadataUrl'
:
settings
.
YOUTUBE
[
'METADATA_URL'
],
'ytKey'
:
yt_api_key
,
'transcriptTranslationUrl'
:
self
.
runtime
.
handler_url
(
'transcriptTranslationUrl'
:
self
.
runtime
.
handler_url
(
self
,
'transcript'
,
'translation/__lang__'
self
,
'transcript'
,
'translation/__lang__'
)
.
rstrip
(
'/?'
),
)
.
rstrip
(
'/?'
),
...
...
common/test/acceptance/tests/helpers.py
View file @
f0754175
...
@@ -67,8 +67,7 @@ def is_youtube_available():
...
@@ -67,8 +67,7 @@ def is_youtube_available():
youtube_api_urls
=
{
youtube_api_urls
=
{
'main'
:
'https://www.youtube.com/'
,
'main'
:
'https://www.youtube.com/'
,
'player'
:
'http://www.youtube.com/iframe_api'
,
'player'
:
'https://www.youtube.com/iframe_api'
,
'metadata'
:
'http://gdata.youtube.com/feeds/api/videos/'
,
# For transcripts, you need to check an actual video, so we will
# For transcripts, you need to check an actual video, so we will
# just specify our default video and see if that one is available.
# just specify our default video and see if that one is available.
'transcript'
:
'http://video.google.com/timedtext?lang=en&v=3_yD_cEKoCk'
,
'transcript'
:
'http://video.google.com/timedtext?lang=en&v=3_yD_cEKoCk'
,
...
...
common/test/acceptance/tests/video/test_video_events.py
View file @
f0754175
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
import
datetime
import
datetime
import
json
import
json
import
ddt
import
ddt
from
unittest
import
skip
from
..helpers
import
EventsTestMixin
from
..helpers
import
EventsTestMixin
from
.test_video_module
import
VideoBaseTest
from
.test_video_module
import
VideoBaseTest
...
@@ -60,6 +61,7 @@ class VideoEventsTestMixin(EventsTestMixin, VideoBaseTest):
...
@@ -60,6 +61,7 @@ class VideoEventsTestMixin(EventsTestMixin, VideoBaseTest):
class
VideoEventsTest
(
VideoEventsTestMixin
):
class
VideoEventsTest
(
VideoEventsTestMixin
):
""" Test video player event emission """
""" Test video player event emission """
@skip
(
"Failing on Cypress"
)
def
test_video_control_events
(
self
):
def
test_video_control_events
(
self
):
"""
"""
Scenario: Video component is rendered in the LMS in Youtube mode without HTML5 sources
Scenario: Video component is rendered in the LMS in Youtube mode without HTML5 sources
...
@@ -195,6 +197,7 @@ class VideoBumperEventsTest(VideoEventsTestMixin):
...
@@ -195,6 +197,7 @@ class VideoBumperEventsTest(VideoEventsTestMixin):
(
'edx.video.bumper.stopped'
,
wait_for_state
)
(
'edx.video.bumper.stopped'
,
wait_for_state
)
)
)
@ddt.unpack
@ddt.unpack
@skip
(
"Failing on master; To see remove is_youtube_available() form base class"
)
def
test_video_control_events
(
self
,
event_type
,
action
):
def
test_video_control_events
(
self
,
event_type
,
action
):
"""
"""
Scenario: Video component with pre-roll emits events correctly
Scenario: Video component with pre-roll emits events correctly
...
@@ -285,6 +288,7 @@ class VideoBumperEventsTest(VideoEventsTestMixin):
...
@@ -285,6 +288,7 @@ class VideoBumperEventsTest(VideoEventsTestMixin):
}
}
self
.
assert_events_match
([
expected_event
],
[
video_event
])
self
.
assert_events_match
([
expected_event
],
[
video_event
])
@skip
(
"Failing on master; To see remove is_youtube_available() form base class"
)
def
test_strict_event_format
(
self
):
def
test_strict_event_format
(
self
):
"""
"""
This test makes a very strong assertion about the fields present in events. The goal of it is to ensure that new
This test makes a very strong assertion about the fields present in events. The goal of it is to ensure that new
...
...
common/test/acceptance/tests/video/test_video_module.py
View file @
f0754175
...
@@ -404,6 +404,7 @@ class YouTubeVideoTest(VideoBaseTest):
...
@@ -404,6 +404,7 @@ class YouTubeVideoTest(VideoBaseTest):
self
.
assertTrue
(
self
.
video
.
is_video_rendered
(
'html5'
))
self
.
assertTrue
(
self
.
video
.
is_video_rendered
(
'html5'
))
@skip
(
'Failing on master; To see remove is_youtube_available() form base class'
)
def
test_download_transcript_button_works_correctly
(
self
):
def
test_download_transcript_button_works_correctly
(
self
):
"""
"""
Scenario: Download Transcript button works correctly
Scenario: Download Transcript button works correctly
...
@@ -712,6 +713,7 @@ class YouTubeVideoTest(VideoBaseTest):
...
@@ -712,6 +713,7 @@ class YouTubeVideoTest(VideoBaseTest):
self
.
assertEqual
(
self
.
video
.
caption_languages
,
{
'zh_HANS'
:
'Simplified Chinese'
,
'zh_HANT'
:
'Traditional Chinese'
})
self
.
assertEqual
(
self
.
video
.
caption_languages
,
{
'zh_HANS'
:
'Simplified Chinese'
,
'zh_HANT'
:
'Traditional Chinese'
})
@skip
(
'Failing on master; To see remove is_youtube_available() form base class'
)
def
test_video_bumper_render
(
self
):
def
test_video_bumper_render
(
self
):
"""
"""
Scenario: Multiple videos with bumper in sequentials all load and work, switching between sequentials
Scenario: Multiple videos with bumper in sequentials all load and work, switching between sequentials
...
...
lms/djangoapps/courseware/features/video.feature
View file @
f0754175
...
@@ -3,7 +3,7 @@ Feature: LMS.Video component
...
@@ -3,7 +3,7 @@ Feature: LMS.Video component
As a student, I want to view course videos in LMS
As a student, I want to view course videos in LMS
# 1
# 1
Scenario
:
Verify that each video in
each sub-section includes a transcript for
non-Youtube countries
Scenario
:
Verify that each video in
sub-section includes a transcript for Youtube and
non-Youtube countries
Given
youtube server is up and response time is 2 seconds
Given
youtube server is up and response time is 2 seconds
And
I am registered for the course
"test_course"
And
I am registered for the course
"test_course"
And
I have a
"subs_3_yD_cEKoCk.srt.sjson"
transcript file in assets
And
I have a
"subs_3_yD_cEKoCk.srt.sjson"
transcript file in assets
...
@@ -24,9 +24,9 @@ Feature: LMS.Video component
...
@@ -24,9 +24,9 @@ Feature: LMS.Video component
|
Welcome
to
edX.
|
|
Welcome
to
edX.
|
|
Equal
transcripts
|
|
Equal
transcripts
|
When
I open video
"C"
When
I open video
"C"
Then
the video has rendered in
"
HTML5
"
mode
Then
the video has rendered in
"
YOUTUBE
"
mode
And
I make sure captions are opened
And
I make sure captions are opened
And
I see
"好 各位同学"
text in the captions
And
I see
"好 各位同学"
text in the captions
When
I open video
"D"
When
I open video
"D"
Then
the video has rendered in
"
HTML5
"
mode
Then
the video has rendered in
"
YOUTUBE
"
mode
And
the video does not show the captions
And
I make sure captions are opened
lms/djangoapps/courseware/tests/test_video_mongo.py
View file @
f0754175
...
@@ -62,8 +62,9 @@ class TestVideoYouTube(TestVideo):
...
@@ -62,8 +62,9 @@ class TestVideoYouTube(TestVideo):
"transcriptLanguage"
:
"en"
,
"transcriptLanguage"
:
"en"
,
"transcriptLanguages"
:
OrderedDict
({
"en"
:
"English"
,
"uk"
:
u"Українська"
}),
"transcriptLanguages"
:
OrderedDict
({
"en"
:
"English"
,
"uk"
:
u"Українська"
}),
"ytTestTimeout"
:
1500
,
"ytTestTimeout"
:
1500
,
"ytApiUrl"
:
"www.youtube.com/iframe_api"
,
"ytApiUrl"
:
"https://www.youtube.com/iframe_api"
,
"ytTestUrl"
:
"gdata.youtube.com/feeds/api/videos/"
,
"ytMetadataUrl"
:
"https://www.googleapis.com/youtube/v3/videos/"
,
"ytKey"
:
None
,
"transcriptTranslationUrl"
:
self
.
item_descriptor
.
xmodule_runtime
.
handler_url
(
"transcriptTranslationUrl"
:
self
.
item_descriptor
.
xmodule_runtime
.
handler_url
(
self
.
item_descriptor
,
'transcript'
,
'translation/__lang__'
self
.
item_descriptor
,
'transcript'
,
'translation/__lang__'
)
.
rstrip
(
'/?'
),
)
.
rstrip
(
'/?'
),
...
@@ -139,8 +140,9 @@ class TestVideoNonYouTube(TestVideo):
...
@@ -139,8 +140,9 @@ class TestVideoNonYouTube(TestVideo):
"transcriptLanguage"
:
"en"
,
"transcriptLanguage"
:
"en"
,
"transcriptLanguages"
:
OrderedDict
({
"en"
:
"English"
}),
"transcriptLanguages"
:
OrderedDict
({
"en"
:
"English"
}),
"ytTestTimeout"
:
1500
,
"ytTestTimeout"
:
1500
,
"ytApiUrl"
:
"www.youtube.com/iframe_api"
,
"ytApiUrl"
:
"https://www.youtube.com/iframe_api"
,
"ytTestUrl"
:
"gdata.youtube.com/feeds/api/videos/"
,
"ytMetadataUrl"
:
"https://www.googleapis.com/youtube/v3/videos/"
,
"ytKey"
:
None
,
"transcriptTranslationUrl"
:
self
.
item_descriptor
.
xmodule_runtime
.
handler_url
(
"transcriptTranslationUrl"
:
self
.
item_descriptor
.
xmodule_runtime
.
handler_url
(
self
.
item_descriptor
,
'transcript'
,
'translation/__lang__'
self
.
item_descriptor
,
'transcript'
,
'translation/__lang__'
)
.
rstrip
(
'/?'
),
)
.
rstrip
(
'/?'
),
...
@@ -192,8 +194,9 @@ class TestGetHtmlMethod(BaseTestXmodule):
...
@@ -192,8 +194,9 @@ class TestGetHtmlMethod(BaseTestXmodule):
"transcriptLanguage"
:
"en"
,
"transcriptLanguage"
:
"en"
,
"transcriptLanguages"
:
OrderedDict
({
"en"
:
"English"
}),
"transcriptLanguages"
:
OrderedDict
({
"en"
:
"English"
}),
"ytTestTimeout"
:
1500
,
"ytTestTimeout"
:
1500
,
"ytApiUrl"
:
"www.youtube.com/iframe_api"
,
"ytApiUrl"
:
"https://www.youtube.com/iframe_api"
,
"ytTestUrl"
:
"gdata.youtube.com/feeds/api/videos/"
,
"ytMetadataUrl"
:
"https://www.googleapis.com/youtube/v3/videos/"
,
"ytKey"
:
None
,
"transcriptTranslationUrl"
:
self
.
item_descriptor
.
xmodule_runtime
.
handler_url
(
"transcriptTranslationUrl"
:
self
.
item_descriptor
.
xmodule_runtime
.
handler_url
(
self
.
item_descriptor
,
'transcript'
,
'translation/__lang__'
self
.
item_descriptor
,
'transcript'
,
'translation/__lang__'
)
.
rstrip
(
'/?'
),
)
.
rstrip
(
'/?'
),
...
@@ -1181,8 +1184,9 @@ class TestVideoWithBumper(TestVideo):
...
@@ -1181,8 +1184,9 @@ class TestVideoWithBumper(TestVideo):
"transcriptLanguage"
:
"en"
,
"transcriptLanguage"
:
"en"
,
"transcriptLanguages"
:
OrderedDict
({
"en"
:
"English"
,
"uk"
:
u"Українська"
}),
"transcriptLanguages"
:
OrderedDict
({
"en"
:
"English"
,
"uk"
:
u"Українська"
}),
"ytTestTimeout"
:
1500
,
"ytTestTimeout"
:
1500
,
"ytApiUrl"
:
"www.youtube.com/iframe_api"
,
"ytApiUrl"
:
"https://www.youtube.com/iframe_api"
,
"ytTestUrl"
:
"gdata.youtube.com/feeds/api/videos/"
,
"ytMetadataUrl"
:
"https://www.googleapis.com/youtube/v3/videos/"
,
"ytKey"
:
None
,
"transcriptTranslationUrl"
:
self
.
item_descriptor
.
xmodule_runtime
.
handler_url
(
"transcriptTranslationUrl"
:
self
.
item_descriptor
.
xmodule_runtime
.
handler_url
(
self
.
item_descriptor
,
'transcript'
,
'translation/__lang__'
self
.
item_descriptor
,
'transcript'
,
'translation/__lang__'
)
.
rstrip
(
'/?'
),
)
.
rstrip
(
'/?'
),
...
...
lms/envs/acceptance.py
View file @
f0754175
...
@@ -175,8 +175,8 @@ XQUEUE_INTERFACE = {
...
@@ -175,8 +175,8 @@ XQUEUE_INTERFACE = {
}
}
# Point the URL used to test YouTube availability to our stub YouTube server
# Point the URL used to test YouTube availability to our stub YouTube server
YOUTUBE
[
'API'
]
=
"127.0.0.1:{0}/get_youtube_api/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'API'
]
=
"
http://
127.0.0.1:{0}/get_youtube_api/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'
TEST_URL'
]
=
"
127.0.0.1:{0}/test_youtube/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'
METADATA_URL'
]
=
"http://
127.0.0.1:{0}/test_youtube/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'TEXT_API'
][
'url'
]
=
"127.0.0.1:{0}/test_transcripts_youtube/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'TEXT_API'
][
'url'
]
=
"127.0.0.1:{0}/test_transcripts_youtube/"
.
format
(
YOUTUBE_PORT
)
if
FEATURES
.
get
(
'ENABLE_COURSEWARE_SEARCH'
)
or
\
if
FEATURES
.
get
(
'ENABLE_COURSEWARE_SEARCH'
)
or
\
...
...
lms/envs/aws.py
View file @
f0754175
...
@@ -625,6 +625,7 @@ FACEBOOK_APP_ID = AUTH_TOKENS.get("FACEBOOK_APP_ID")
...
@@ -625,6 +625,7 @@ FACEBOOK_APP_ID = AUTH_TOKENS.get("FACEBOOK_APP_ID")
XBLOCK_SETTINGS
=
ENV_TOKENS
.
get
(
'XBLOCK_SETTINGS'
,
{})
XBLOCK_SETTINGS
=
ENV_TOKENS
.
get
(
'XBLOCK_SETTINGS'
,
{})
XBLOCK_SETTINGS
.
setdefault
(
"VideoDescriptor"
,
{})[
"licensing_enabled"
]
=
FEATURES
.
get
(
"LICENSING"
,
False
)
XBLOCK_SETTINGS
.
setdefault
(
"VideoDescriptor"
,
{})[
"licensing_enabled"
]
=
FEATURES
.
get
(
"LICENSING"
,
False
)
XBLOCK_SETTINGS
.
setdefault
(
"VideoModule"
,
{})[
'YOUTUBE_API_KEY'
]
=
AUTH_TOKENS
.
get
(
'YOUTUBE_API_KEY'
,
YOUTUBE_API_KEY
)
##### CDN EXPERIMENT/MONITORING FLAGS #####
##### CDN EXPERIMENT/MONITORING FLAGS #####
CDN_VIDEO_URLS
=
ENV_TOKENS
.
get
(
'CDN_VIDEO_URLS'
,
CDN_VIDEO_URLS
)
CDN_VIDEO_URLS
=
ENV_TOKENS
.
get
(
'CDN_VIDEO_URLS'
,
CDN_VIDEO_URLS
)
...
...
lms/envs/bok_choy.py
View file @
f0754175
...
@@ -115,8 +115,8 @@ FEATURES['ENTRANCE_EXAMS'] = True
...
@@ -115,8 +115,8 @@ FEATURES['ENTRANCE_EXAMS'] = True
# Point the URL used to test YouTube availability to our stub YouTube server
# Point the URL used to test YouTube availability to our stub YouTube server
YOUTUBE_PORT
=
9080
YOUTUBE_PORT
=
9080
YOUTUBE
[
'API'
]
=
"127.0.0.1:{0}/get_youtube_api/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'API'
]
=
"
http://
127.0.0.1:{0}/get_youtube_api/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'
TEST_URL'
]
=
"
127.0.0.1:{0}/test_youtube/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'
METADATA_URL'
]
=
"http://
127.0.0.1:{0}/test_youtube/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'TEXT_API'
][
'url'
]
=
"127.0.0.1:{0}/test_transcripts_youtube/"
.
format
(
YOUTUBE_PORT
)
YOUTUBE
[
'TEXT_API'
][
'url'
]
=
"127.0.0.1:{0}/test_transcripts_youtube/"
.
format
(
YOUTUBE_PORT
)
############################# SECURITY SETTINGS ################################
############################# SECURITY SETTINGS ################################
...
...
lms/envs/common.py
View file @
f0754175
...
@@ -1737,10 +1737,10 @@ EMAIL_OPTIN_MINIMUM_AGE = PARENTAL_CONSENT_AGE_LIMIT
...
@@ -1737,10 +1737,10 @@ EMAIL_OPTIN_MINIMUM_AGE = PARENTAL_CONSENT_AGE_LIMIT
YOUTUBE
=
{
YOUTUBE
=
{
# YouTube JavaScript API
# YouTube JavaScript API
'API'
:
'www.youtube.com/iframe_api'
,
'API'
:
'
https://
www.youtube.com/iframe_api'
,
# URL to
test YouTube availability
# URL to
get YouTube metadata
'
TEST_URL'
:
'gdata.youtube.com/feeds/api
/videos/'
,
'
METADATA_URL'
:
'https://www.googleapis.com/youtube/v3
/videos/'
,
# Current youtube api for requesting transcripts.
# Current youtube api for requesting transcripts.
# For example: http://video.google.com/timedtext?lang=en&v=j_jEn79vS3g.
# For example: http://video.google.com/timedtext?lang=en&v=j_jEn79vS3g.
...
@@ -1754,6 +1754,7 @@ YOUTUBE = {
...
@@ -1754,6 +1754,7 @@ YOUTUBE = {
'IMAGE_API'
:
'http://img.youtube.com/vi/{youtube_id}/0.jpg'
,
# /maxresdefault.jpg for 1920*1080
'IMAGE_API'
:
'http://img.youtube.com/vi/{youtube_id}/0.jpg'
,
# /maxresdefault.jpg for 1920*1080
}
}
YOUTUBE_API_KEY
=
None
################################### APPS ######################################
################################### APPS ######################################
INSTALLED_APPS
=
(
INSTALLED_APPS
=
(
...
...
lms/static/js_test.yml
View file @
f0754175
...
@@ -61,6 +61,7 @@ lib_paths:
...
@@ -61,6 +61,7 @@ lib_paths:
-
xmodule_js/common_static/js/vendor/edxnotes/annotator-full.min.js
-
xmodule_js/common_static/js/vendor/edxnotes/annotator-full.min.js
-
xmodule_js/common_static/js/test/i18n.js
-
xmodule_js/common_static/js/test/i18n.js
-
xmodule_js/common_static/js/vendor/date.js
-
xmodule_js/common_static/js/vendor/date.js
-
xmodule_js/common_static/js/vendor/moment.min.js
# Paths to source JavaScript files
# Paths to source JavaScript files
src_paths
:
src_paths
:
...
...
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