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
90e2e0f3
Commit
90e2e0f3
authored
Feb 07, 2012
by
Ernie Park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make video player use one play/pause button that toggles
parent
85a29648
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
video.html
+1
-2
video_init.js
+14
-1
No files found.
video.html
View file @
90e2e0f3
...
...
@@ -15,8 +15,7 @@
<section>
<ul
class=
"vcr"
>
<li><a
class=
"play"
onclick=
"play();"
>
Play
</a></li>
<li><a
class=
"pause"
onclick=
"pause();"
>
Pause
</a></li>
<li><a
id=
"video_control"
class=
"pause"
>
Pause
</a></li>
</ul>
<div
id=
"vidtime"
>
0:00/0:00
</div>
...
...
video_init.js
View file @
90e2e0f3
...
...
@@ -34,7 +34,7 @@ loadNewVideo(streams["1.0"], ${ position });
function
add_speed
(
key
,
stream
)
{
var
id
=
'speed_'
+
stream
;
$
(
"#video_speeds"
).
append
(
' <span id="'
+
id
+
'">'
+
key
+
'
X
</span>'
);
$
(
"#video_speeds"
).
append
(
' <span id="'
+
id
+
'">'
+
key
+
'
x
</span>'
);
$
(
"#"
+
id
).
click
(
function
(){
change_video_speed
(
key
,
stream
);
});
...
...
@@ -57,3 +57,16 @@ l.sort(sort_by_value);
for
(
var
i
=
0
;
i
<
l
.
length
;
i
++
)
{
add_speed
(
l
[
i
],
streams
[
l
[
i
]])
}
//toggle video play/pause. the HTML assumes video is always autoplayed
//initially since it starts with class "pause". may want to set that in
//javascript
$
(
"#video_control"
).
click
(
function
(){
if
(
$
(
this
).
hasClass
(
"play"
)){
play
();
$
(
this
).
removeClass
().
addClass
(
"pause"
);
}
else
{
pause
();
$
(
this
).
removeClass
().
addClass
(
"play"
);
}
});
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