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
a470a62d
Commit
a470a62d
authored
Feb 06, 2013
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hack to disable YouTube <iframe> API when they break it.
parent
e5fda33e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
common/lib/xmodule/xmodule/video_module.py
+13
-1
lms/envs/common.py
+3
-0
lms/templates/video.html
+11
-1
No files found.
common/lib/xmodule/xmodule/video_module.py
View file @
a470a62d
...
@@ -128,6 +128,17 @@ class VideoModule(XModule):
...
@@ -128,6 +128,17 @@ class VideoModule(XModule):
else
:
else
:
caption_asset_path
=
StaticContent
.
get_base_url_path_for_course_assets
(
self
.
location
)
+
'/subs_'
caption_asset_path
=
StaticContent
.
get_base_url_path_for_course_assets
(
self
.
location
)
+
'/subs_'
# We normally let JS parse this, but in the case that we need a hacked
# out <object> player because YouTube has broken their <iframe> API for
# the third time in a year, we need to extract it server side.
normal_speed_video_id
=
None
# The 1.0 speed video
# video_list() example:
# "0.75:nugHYNiD3fI,1.0:7m8pab1MfYY,1.25:3CxdPGXShq8,1.50:F-D7bOFCnXA"
for
video_id_str
in
self
.
video_list
()
.
split
(
","
):
if
video_id_str
.
startswith
(
"1.0:"
):
normal_speed_video_id
=
video_id_str
.
split
(
":"
)[
1
]
return
self
.
system
.
render_template
(
'video.html'
,
{
return
self
.
system
.
render_template
(
'video.html'
,
{
'streams'
:
self
.
video_list
(),
'streams'
:
self
.
video_list
(),
'id'
:
self
.
location
.
html_id
(),
'id'
:
self
.
location
.
html_id
(),
...
@@ -140,7 +151,8 @@ class VideoModule(XModule):
...
@@ -140,7 +151,8 @@ class VideoModule(XModule):
'caption_asset_path'
:
caption_asset_path
,
'caption_asset_path'
:
caption_asset_path
,
'show_captions'
:
self
.
show_captions
,
'show_captions'
:
self
.
show_captions
,
'start'
:
self
.
start_time
,
'start'
:
self
.
start_time
,
'end'
:
self
.
end_time
'end'
:
self
.
end_time
,
'normal_speed_video_id'
:
normal_speed_video_id
})
})
...
...
lms/envs/common.py
View file @
a470a62d
...
@@ -81,6 +81,9 @@ MITX_FEATURES = {
...
@@ -81,6 +81,9 @@ MITX_FEATURES = {
'AUTH_USE_OPENID'
:
False
,
'AUTH_USE_OPENID'
:
False
,
'AUTH_USE_MIT_CERTIFICATES'
:
False
,
'AUTH_USE_MIT_CERTIFICATES'
:
False
,
'AUTH_USE_OPENID_PROVIDER'
:
False
,
'AUTH_USE_OPENID_PROVIDER'
:
False
,
# When the YouTube iframe API breaks
'USE_YOUTUBE_OBJECT_API'
:
True
,
}
}
# Used for A/B testing
# Used for A/B testing
...
...
lms/templates/video.html
View file @
a470a62d
...
@@ -2,9 +2,19 @@
...
@@ -2,9 +2,19 @@
<h2>
${display_name}
</h2>
<h2>
${display_name}
</h2>
% endif
% endif
%if settings.MITX_FEATURES['STUB_VIDEO_FOR_TESTING']:
%if settings.MITX_FEATURES['STUB_VIDEO_FOR_TESTING']:
<div
id=
"stub_out_video_for_testing"
></div>
<div
id=
"stub_out_video_for_testing"
></div>
%elif settings.MITX_FEATURES.get('USE_YOUTUBE_OBJECT_API') and normal_speed_video_id:
<object
width=
"640"
height=
"390"
>
<param
name=
"movie"
value=
"https://www.youtube.com/v/${normal_speed_video_id}?version=3&autoplay=1&rel=0"
></param>
<param
name=
"allowScriptAccess"
value=
"always"
></param>
<embed
src=
"https://www.youtube.com/v/${normal_speed_video_id}?version=3&autoplay=1&rel=0"
type=
"application/x-shockwave-flash"
allowscriptaccess=
"always"
width=
"640"
height=
"390"
></embed>
</object>
%else:
%else:
<div
id=
"video_${id}"
class=
"video"
data-streams=
"${streams}"
data-caption-data-dir=
"${data_dir}"
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-caption-data-dir=
"${data_dir}"
data-show-captions=
"${show_captions}"
data-start=
"${start}"
data-end=
"${end}"
data-caption-asset-path=
"${caption_asset_path}"
>
<div
class=
"tc-wrapper"
>
<div
class=
"tc-wrapper"
>
...
...
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