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
0e1a56d9
Commit
0e1a56d9
authored
Sep 16, 2012
by
arjun810
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #699 from MITx/kimth/remember-caption
Kimth/remember caption
parents
b681e2bd
68e07011
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
7 deletions
+17
-7
common/lib/xmodule/xmodule/js/src/video/display.coffee
+2
-0
common/lib/xmodule/xmodule/js/src/video/display/video_caption.coffee
+14
-7
common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee
+1
-0
No files found.
common/lib/xmodule/xmodule/js/src/video/display.coffee
View file @
0e1a56d9
...
...
@@ -11,6 +11,8 @@ class @Video
@
parseSpeed
()
$
(
"#video_
#{
@
id
}
"
).
data
(
'video'
,
this
).
addClass
(
'video-load-complete'
)
@
hide_captions
=
$
.
cookie
(
'hide_captions'
)
==
'true'
if
YT
.
Player
@
embed
()
else
...
...
common/lib/xmodule/xmodule/js/src/video/display/video_caption.coffee
View file @
0e1a56d9
class
@
VideoCaption
extends
Subview
initialize
:
->
@
loaded
=
false
@
loaded
=
false
bind
:
->
$
(
window
).
bind
(
'resize'
,
@
resize
)
...
...
@@ -49,7 +49,7 @@ class @VideoCaption extends Subview
@
$
(
'.subtitles'
).
html
(
container
.
html
())
@
$
(
'.subtitles li[data-index]'
).
click
@
seekPlayer
# prepend and append an empty <li> for cosm
a
tic reason
# prepend and append an empty <li> for cosm
e
tic reason
@
$
(
'.subtitles'
).
prepend
(
$
(
'<li class="spacing">'
).
height
(
@
topSpacingHeight
()))
.
append
(
$
(
'<li class="spacing">'
).
height
(
@
bottomSpacingHeight
()))
...
...
@@ -130,14 +130,21 @@ class @VideoCaption extends Subview
toggle
:
(
event
)
=>
event
.
preventDefault
()
if
@
el
.
hasClass
(
'closed'
)
if
@
el
.
hasClass
(
'closed'
)
# Captions are "closed" e.g. turned off
@
hideCaptions
(
false
)
else
# Captions are on
@
hideCaptions
(
true
)
hideCaptions
:
(
hide_captions
)
=>
if
hide_captions
@
$
(
'.hide-subtitles'
).
attr
(
'title'
,
'Turn on captions'
)
@
el
.
addClass
(
'closed'
)
else
@
$
(
'.hide-subtitles'
).
attr
(
'title'
,
'Turn off captions'
)
@
el
.
removeClass
(
'closed'
)
@
scrollCaption
()
else
@
$
(
'.hide-subtitles'
).
attr
(
'title'
,
'Turn on captions'
)
@
el
.
addClass
(
'closed'
)
$
.
cookie
(
'hide_captions'
,
hide_captions
,
expires
:
3650
,
path
:
'/'
)
captionHeight
:
->
if
@
el
.
hasClass
(
'fullscreen'
)
$
(
window
).
height
()
-
@
$
(
'.video-controls'
).
height
()
...
...
common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee
View file @
0e1a56d9
...
...
@@ -45,6 +45,7 @@ class @VideoPlayer extends Subview
events
:
onReady
:
@
onReady
onStateChange
:
@
onStateChange
@
caption
.
hideCaptions
(
@
[
'video'
].
hide_captions
)
addToolTip
:
->
@
$
(
'.add-fullscreen, .hide-subtitles'
).
qtip
...
...
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