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
5c5d1140
Commit
5c5d1140
authored
Aug 29, 2012
by
Arjun Singh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Temporary fix to make uncaptioned videos display reasonably. Will replace with proper solution.
parent
30543d45
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
2 deletions
+9
-2
common/lib/xmodule/xmodule/js/src/video/display.coffee
+1
-0
common/lib/xmodule/xmodule/js/src/video/display/video_caption.coffee
+5
-1
common/lib/xmodule/xmodule/video_module.py
+2
-0
lms/templates/video.html
+1
-1
No files found.
common/lib/xmodule/xmodule/js/src/video/display.coffee
View file @
5c5d1140
...
...
@@ -3,6 +3,7 @@ class @Video
@
el
=
$
(
element
).
find
(
'.video'
)
@
id
=
@
el
.
attr
(
'id'
).
replace
(
/video_/
,
''
)
@
caption_data_dir
=
@
el
.
data
(
'caption-data-dir'
)
@
show_captions
=
@
el
.
data
(
'show-captions'
)
==
"true"
window
.
player
=
null
@
el
=
$
(
"#video_
#{
@
id
}
"
)
@
parseVideos
@
el
.
data
(
'streams'
)
...
...
common/lib/xmodule/xmodule/js/src/video/display/video_caption.coffee
View file @
5c5d1140
...
...
@@ -13,8 +13,12 @@ class @VideoCaption extends Subview
"/static/
#{
@
captionDataDir
}
/subs/
#{
@
youtubeId
}
.srt.sjson"
render
:
->
# TODO: make it so you can have a video with no captions.
#@$('.video-wrapper').after """
# <ol class="subtitles"><li>Attempting to load captions...</li></ol>
# """
@
$
(
'.video-wrapper'
).
after
"""
<ol class="subtitles"><
li>Attempting to load captions...</li><
/ol>
<ol class="subtitles"></ol>
"""
@
$
(
'.video-controls .secondary-controls'
).
append
"""
<a href="#" class="hide-subtitles" title="Turn off captions">Captions</a>
...
...
common/lib/xmodule/xmodule/video_module.py
View file @
5c5d1140
...
...
@@ -30,6 +30,7 @@ class VideoModule(XModule):
xmltree
=
etree
.
fromstring
(
self
.
definition
[
'data'
])
self
.
youtube
=
xmltree
.
get
(
'youtube'
)
self
.
position
=
0
self
.
show_captions
=
xmltree
.
get
(
'show_captions'
,
'true'
)
if
instance_state
is
not
None
:
state
=
json
.
loads
(
instance_state
)
...
...
@@ -75,6 +76,7 @@ class VideoModule(XModule):
'display_name'
:
self
.
display_name
,
# TODO (cpennington): This won't work when we move to data that isn't on the filesystem
'data_dir'
:
self
.
metadata
[
'data_dir'
],
'show_captions'
:
self
.
show_captions
})
...
...
lms/templates/video.html
View file @
5c5d1140
...
...
@@ -2,7 +2,7 @@
<h2>
${display_name}
</h2>
% endif
<div
id=
"video_${id}"
class=
"video"
data-streams=
"${streams}"
data-caption-data-dir=
"${data_dir}"
>
<div
id=
"video_${id}"
class=
"video"
data-streams=
"${streams}"
data-caption-data-dir=
"${data_dir}"
data-show-captions=
"${show_captions}"
>
<div
class=
"tc-wrapper"
>
<article
class=
"video-wrapper"
>
<section
class=
"video-player"
>
...
...
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