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
823843cd
Commit
823843cd
authored
May 09, 2012
by
Prem Sichanugrist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure video is working in sequence module
parent
b0149541
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
9 deletions
+22
-9
static/coffee/src/courseware.coffee
+7
-2
templates/coffee/src/modules/sequence.coffee
+3
-2
templates/coffee/src/modules/video.coffee
+10
-5
templates/coffee/src/modules/video/video_player.coffee
+2
-0
No files found.
static/coffee/src/courseware.coffee
View file @
823843cd
...
@@ -4,12 +4,17 @@ class window.Courseware
...
@@ -4,12 +4,17 @@ class window.Courseware
new
Calculator
new
Calculator
new
FeedbackForm
new
FeedbackForm
Logger
.
bind
()
Logger
.
bind
()
@
renderModules
()
@
bind
()
@
render
()
@
start
:
->
@
start
:
->
new
Courseware
new
Courseware
renderModules
:
->
bind
:
->
if
$
(
'#seq_content'
).
length
$
(
'#seq_content'
).
change
@
render
render
:
->
$
(
'.course-content .video'
).
each
->
$
(
'.course-content .video'
).
each
->
id
=
$
(
this
).
attr
(
'id'
).
replace
(
/video_/
,
''
)
id
=
$
(
this
).
attr
(
'id'
).
replace
(
/video_/
,
''
)
new
Video
id
,
$
(
this
).
data
(
'streams'
)
new
Video
id
,
$
(
this
).
data
(
'streams'
)
templates/coffee/src/modules/sequence.coffee
View file @
823843cd
...
@@ -6,6 +6,7 @@ class window.Sequence
...
@@ -6,6 +6,7 @@ class window.Sequence
bind
:
->
bind
:
->
$
(
'#sequence-list a'
).
click
@
goto
$
(
'#sequence-list a'
).
click
@
goto
$
(
'#seq_content'
).
change
@
toggleArrows
buildNavigation
:
->
buildNavigation
:
->
$
.
each
@
elements
,
(
index
,
item
)
->
$
.
each
@
elements
,
(
index
,
item
)
->
...
@@ -14,7 +15,7 @@ class window.Sequence
...
@@ -14,7 +15,7 @@ class window.Sequence
list_item
=
$
(
'<li>'
).
append
(
link
.
append
(
title
))
list_item
=
$
(
'<li>'
).
append
(
link
.
append
(
title
))
$
(
'#sequence-list'
).
append
list_item
$
(
'#sequence-list'
).
append
list_item
toggleArrows
:
-
>
toggleArrows
:
=
>
$
(
'.sequence-nav-buttons a'
).
unbind
(
'click'
)
$
(
'.sequence-nav-buttons a'
).
unbind
(
'click'
)
if
@
position
==
1
if
@
position
==
1
...
@@ -38,7 +39,7 @@ class window.Sequence
...
@@ -38,7 +39,7 @@ class window.Sequence
MathJax
.
Hub
.
Queue
([
"Typeset"
,
MathJax
.
Hub
])
MathJax
.
Hub
.
Queue
([
"Typeset"
,
MathJax
.
Hub
])
@
position
=
new_position
@
position
=
new_position
@
toggleArrows
()
$
(
'#seq_content'
).
change
()
goto
:
(
event
)
=>
goto
:
(
event
)
=>
event
.
preventDefault
()
event
.
preventDefault
()
...
...
templates/coffee/src/modules/video.coffee
View file @
823843cd
class
Video
class
Video
constructor
:
(
@
id
,
videos
)
->
constructor
:
(
@
id
,
videos
)
->
window
.
player
=
null
@
element
=
$
(
"#video_
#{
@
id
}
"
)
@
element
=
$
(
"#video_
#{
@
id
}
"
)
@
parseVideos
videos
@
parseVideos
videos
@
fetchMetadata
()
@
parseSpeed
()
$
(
"#video_
#{
@
id
}
"
).
data
(
'video'
,
this
)
$
(
"#video_
#{
@
id
}
"
).
data
(
'video'
,
this
)
window
.
onYouTubePlayerAPIReady
=
=>
$
(
'.course-content .video'
).
each
->
if
YT
.
Player
$
(
this
).
data
(
'video'
).
embed
()
@
embed
()
else
window
.
onYouTubePlayerAPIReady
=
=>
$
(
'.course-content .video'
).
each
->
$
(
this
).
data
(
'video'
).
embed
()
youtubeId
:
(
speed
)
->
youtubeId
:
(
speed
)
->
@
videos
[
speed
||
@
speed
]
@
videos
[
speed
||
@
speed
]
...
@@ -18,6 +21,8 @@ class Video
...
@@ -18,6 +21,8 @@ class Video
video
=
video
.
split
(
/:/
)
video
=
video
.
split
(
/:/
)
speed
=
parseFloat
(
video
[
0
]).
toFixed
(
2
).
replace
/\.00$/
,
'.0'
speed
=
parseFloat
(
video
[
0
]).
toFixed
(
2
).
replace
/\.00$/
,
'.0'
@
videos
[
speed
]
=
video
[
1
]
@
videos
[
speed
]
=
video
[
1
]
@
fetchMetadata
()
@
parseSpeed
()
parseSpeed
:
->
parseSpeed
:
->
@
setSpeed
(
$
.
cookie
(
'video_speed'
))
@
setSpeed
(
$
.
cookie
(
'video_speed'
))
...
...
templates/coffee/src/modules/video/video_player.coffee
View file @
823843cd
...
@@ -63,12 +63,14 @@ class VideoPlayer
...
@@ -63,12 +63,14 @@ class VideoPlayer
$
(
@
).
trigger
(
'ended'
)
$
(
@
).
trigger
(
'ended'
)
onPlay
:
=>
onPlay
:
=>
Logger
.
log
'play_video'
,
id
:
@
currentTime
,
code
:
@
player
.
getVideoEmbedCode
()
window
.
player
.
pauseVideo
()
if
window
.
player
&&
window
.
player
!=
@
player
window
.
player
.
pauseVideo
()
if
window
.
player
&&
window
.
player
!=
@
player
window
.
player
=
@
player
window
.
player
=
@
player
unless
@
player
.
interval
unless
@
player
.
interval
@
player
.
interval
=
setInterval
(
@
update
,
200
)
@
player
.
interval
=
setInterval
(
@
update
,
200
)
onPause
:
=>
onPause
:
=>
Logger
.
log
'pause_video'
,
id
:
@
currentTime
,
code
:
@
player
.
getVideoEmbedCode
()
window
.
player
=
null
if
window
.
player
==
@
player
window
.
player
=
null
if
window
.
player
==
@
player
clearInterval
(
@
player
.
interval
)
clearInterval
(
@
player
.
interval
)
@
player
.
interval
=
null
@
player
.
interval
=
null
...
...
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