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
e5b11a9c
Commit
e5b11a9c
authored
Oct 30, 2012
by
Carlos Andrés Rocha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add HD control to video player
parent
5223e9d3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
5 deletions
+71
-5
common/lib/xmodule/xmodule/css/video/display.scss
+28
-0
common/lib/xmodule/xmodule/js/src/video/display/video_caption.coffee
+2
-2
common/lib/xmodule/xmodule/js/src/video/display/video_control.coffee
+1
-1
common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee
+12
-1
common/lib/xmodule/xmodule/js/src/video/display/video_quality_control.coffee
+27
-0
common/lib/xmodule/xmodule/js/src/video/display/video_volume_control.coffee
+1
-1
common/static/images/hd.png
+0
-0
No files found.
common/lib/xmodule/xmodule/css/video/display.scss
View file @
e5b11a9c
...
@@ -355,6 +355,34 @@ div.video {
...
@@ -355,6 +355,34 @@ div.video {
}
}
}
}
a
.quality_control
{
background
:
url(../images/hd.png)
center
no-repeat
;
border-right
:
1px
solid
#000
;
@include
box-shadow
(
1px
0
0
#555
,
inset
1px
0
0
#555
);
color
:
#797979
;
display
:
block
;
float
:
left
;
line-height
:
46px
;
//height of play pause buttons
margin-left
:
0
;
padding
:
0
lh
(
.5
);
text-indent
:
-9999px
;
@include
transition
();
width
:
30px
;
&
:hover
{
background-color
:
#444
;
color
:
#fff
;
text-decoration
:
none
;
}
&
.active
{
background-color
:
#F44
;
color
:
#0ff
;
text-decoration
:
none
;
}
}
a
.hide-subtitles
{
a
.hide-subtitles
{
background
:
url('../images/cc.png')
center
no-repeat
;
background
:
url('../images/cc.png')
center
no-repeat
;
color
:
#797979
;
color
:
#797979
;
...
...
common/lib/xmodule/xmodule/js/src/video/display/video_caption.coffee
View file @
e5b11a9c
...
@@ -22,7 +22,7 @@ class @VideoCaption extends Subview
...
@@ -22,7 +22,7 @@ class @VideoCaption extends Subview
"""
"""
@
$
(
'.video-controls .secondary-controls'
).
append
"""
@
$
(
'.video-controls .secondary-controls'
).
append
"""
<a href="#" class="hide-subtitles" title="Turn off captions">Captions</a>
<a href="#" class="hide-subtitles" title="Turn off captions">Captions</a>
"""
"""
#"
@
$
(
'.subtitles'
).
css
maxHeight
:
@
$
(
'.video-wrapper'
).
height
()
-
5
@
$
(
'.subtitles'
).
css
maxHeight
:
@
$
(
'.video-wrapper'
).
height
()
-
5
@
fetchCaption
()
@
fetchCaption
()
...
@@ -144,7 +144,7 @@ class @VideoCaption extends Subview
...
@@ -144,7 +144,7 @@ class @VideoCaption extends Subview
@
el
.
removeClass
(
'closed'
)
@
el
.
removeClass
(
'closed'
)
@
scrollCaption
()
@
scrollCaption
()
$
.
cookie
(
'hide_captions'
,
hide_captions
,
expires
:
3650
,
path
:
'/'
)
$
.
cookie
(
'hide_captions'
,
hide_captions
,
expires
:
3650
,
path
:
'/'
)
captionHeight
:
->
captionHeight
:
->
if
@
el
.
hasClass
(
'fullscreen'
)
if
@
el
.
hasClass
(
'fullscreen'
)
$
(
window
).
height
()
-
@
$
(
'.video-controls'
).
height
()
$
(
window
).
height
()
-
@
$
(
'.video-controls'
).
height
()
...
...
common/lib/xmodule/xmodule/js/src/video/display/video_control.coffee
View file @
e5b11a9c
...
@@ -16,7 +16,7 @@ class @VideoControl extends Subview
...
@@ -16,7 +16,7 @@ class @VideoControl extends Subview
<a href="#" class="add-fullscreen" title="Fill browser">Fill Browser</a>
<a href="#" class="add-fullscreen" title="Fill browser">Fill Browser</a>
</div>
</div>
</div>
</div>
"""
"""
#"
unless
onTouchBasedDevice
()
unless
onTouchBasedDevice
()
@
$
(
'.video_control'
).
addClass
(
'play'
).
html
(
'Play'
)
@
$
(
'.video_control'
).
addClass
(
'play'
).
html
(
'Play'
)
...
...
common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee
View file @
e5b11a9c
...
@@ -9,6 +9,7 @@ class @VideoPlayer extends Subview
...
@@ -9,6 +9,7 @@ class @VideoPlayer extends Subview
bind
:
->
bind
:
->
$
(
@
control
).
bind
(
'play'
,
@
play
)
$
(
@
control
).
bind
(
'play'
,
@
play
)
.
bind
(
'pause'
,
@
pause
)
.
bind
(
'pause'
,
@
pause
)
$
(
@
qualityControl
).
bind
(
'changeQuality'
,
@
handlePlaybackQualityChange
)
$
(
@
caption
).
bind
(
'seek'
,
@
onSeek
)
$
(
@
caption
).
bind
(
'seek'
,
@
onSeek
)
$
(
@
speedControl
).
bind
(
'speedChange'
,
@
onSpeedChange
)
$
(
@
speedControl
).
bind
(
'speedChange'
,
@
onSpeedChange
)
$
(
@
progressSlider
).
bind
(
'seek'
,
@
onSeek
)
$
(
@
progressSlider
).
bind
(
'seek'
,
@
onSeek
)
...
@@ -25,6 +26,7 @@ class @VideoPlayer extends Subview
...
@@ -25,6 +26,7 @@ class @VideoPlayer extends Subview
render
:
->
render
:
->
@
control
=
new
VideoControl
el
:
@
$
(
'.video-controls'
)
@
control
=
new
VideoControl
el
:
@
$
(
'.video-controls'
)
@
qualityControl
=
new
VideoQualityControl
el
:
@
$
(
'.secondary-controls'
)
@
caption
=
new
VideoCaption
@
caption
=
new
VideoCaption
el
:
@
el
el
:
@
el
youtubeId
:
@
video
.
youtubeId
(
'1.0'
)
youtubeId
:
@
video
.
youtubeId
(
'1.0'
)
...
@@ -41,10 +43,12 @@ class @VideoPlayer extends Subview
...
@@ -41,10 +43,12 @@ class @VideoPlayer extends Subview
rel
:
0
rel
:
0
showinfo
:
0
showinfo
:
0
enablejsapi
:
1
enablejsapi
:
1
modestbranding
:
1
videoId
:
@
video
.
youtubeId
()
videoId
:
@
video
.
youtubeId
()
events
:
events
:
onReady
:
@
onReady
onReady
:
@
onReady
onStateChange
:
@
onStateChange
onStateChange
:
@
onStateChange
onPlaybackQualityChange
:
@
onPlaybackQualityChange
@
caption
.
hideCaptions
(
@
[
'video'
].
hide_captions
)
@
caption
.
hideCaptions
(
@
[
'video'
].
hide_captions
)
addToolTip
:
->
addToolTip
:
->
...
@@ -53,7 +57,7 @@ class @VideoPlayer extends Subview
...
@@ -53,7 +57,7 @@ class @VideoPlayer extends Subview
my
:
'top right'
my
:
'top right'
at
:
'top center'
at
:
'top center'
onReady
:
=>
onReady
:
(
event
)
=>
unless
onTouchBasedDevice
()
unless
onTouchBasedDevice
()
$
(
'.video-load-complete:first'
).
data
(
'video'
).
player
.
play
()
$
(
'.video-load-complete:first'
).
data
(
'video'
).
player
.
play
()
...
@@ -68,6 +72,13 @@ class @VideoPlayer extends Subview
...
@@ -68,6 +72,13 @@ class @VideoPlayer extends Subview
when
YT
.
PlayerState
.
ENDED
when
YT
.
PlayerState
.
ENDED
@
onEnded
()
@
onEnded
()
onPlaybackQualityChange
:
(
event
,
value
)
=>
quality
=
@
player
.
getPlaybackQuality
()
@
qualityControl
.
onQualityChange
(
quality
)
handlePlaybackQualityChange
:
(
event
,
value
)
=>
@
player
.
setPlaybackQuality
(
value
)
onUnstarted
:
=>
onUnstarted
:
=>
@
control
.
pause
()
@
control
.
pause
()
@
caption
.
pause
()
@
caption
.
pause
()
...
...
common/lib/xmodule/xmodule/js/src/video/display/video_quality_control.coffee
0 → 100644
View file @
e5b11a9c
class
@
VideoQualityControl
extends
Subview
initialize
:
->
@
quality
=
null
;
bind
:
->
@
$
(
'.quality_control'
).
click
@
toggleQuality
render
:
->
@
el
.
append
"""
<a href="#" class="quality_control" title="HD">HD</a>
"""
#"
onQualityChange
:
(
value
)
->
@
quality
=
value
if
@
quality
in
[
'hd720'
,
'hd1080'
,
'highres'
]
@
el
.
addClass
(
'active'
)
else
@
el
.
removeClass
(
'active'
)
toggleQuality
:
(
event
)
=>
event
.
preventDefault
()
if
@
quality
in
[
'hd720'
,
'hd1080'
,
'highres'
]
newQuality
=
'large'
else
newQuality
=
'hd720'
$
(
@
).
trigger
(
'changeQuality'
,
newQuality
)
\ No newline at end of file
common/lib/xmodule/xmodule/js/src/video/display/video_volume_control.coffee
View file @
e5b11a9c
...
@@ -17,7 +17,7 @@ class @VideoVolumeControl extends Subview
...
@@ -17,7 +17,7 @@ class @VideoVolumeControl extends Subview
<div class="volume-slider"></div>
<div class="volume-slider"></div>
</div>
</div>
</div>
</div>
"""
"""
#"
@
slider
=
@
$
(
'.volume-slider'
).
slider
@
slider
=
@
$
(
'.volume-slider'
).
slider
orientation
:
"vertical"
orientation
:
"vertical"
range
:
"min"
range
:
"min"
...
...
common/static/images/hd.png
0 → 100644
View file @
e5b11a9c
364 Bytes
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