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
30559f17
Commit
30559f17
authored
Feb 13, 2012
by
Kyle Fiedler
Browse files
Options
Browse Files
Download
Plain Diff
Merged in ernies video changes
parents
b30dc6fe
9a17d234
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
10 deletions
+38
-10
mitx_global.html
+23
-3
video_init.js
+15
-7
No files found.
mitx_global.html
View file @
30559f17
...
...
@@ -12,7 +12,7 @@
</section>
<section
class=
"intro-video"
>
<a
rel=
"leanModal"
href=
"#video-overlay"
><img
src=
"/static/images/video-image.pn
g"
alt=
""
/><span>
Watch intro video
</span></a>
<a
id=
"video-overlay-link"
rel=
"leanModal"
href=
"#video-overlay"
><img
src=
"/static/images/video-image.png"
id=
"video-im
g"
alt=
""
/><span>
Watch intro video
</span></a>
</section>
</section>
...
...
@@ -48,12 +48,32 @@
</section>
<div
id=
"video-overlay"
class=
"leanModal_box"
>
<iframe
width=
"560"
height=
"315"
src=
"http://www.youtube.com/embed/p2Q6BrNhdh8?rel=0"
frameborder=
"0"
allowfullscreen
></iframe>
<iframe
id=
"player"
type=
"text/html"
width=
"560"
height=
"390"
src=
"http://www.youtube.com/embed/p2Q6BrNhdh8?enablejsapi=1"
frameborder=
"0"
>
</iframe>
</div>
<script>
var
player
;
function
onYouTubePlayerAPIReady
()
{
player
=
new
YT
.
Player
(
'player'
,
{
});
}
$
(
function
()
{
var
tag
=
document
.
createElement
(
'script'
);
tag
.
src
=
"http://www.youtube.com/player_api"
;
var
firstScriptTag
=
document
.
getElementsByTagName
(
'script'
)[
0
];
firstScriptTag
.
parentNode
.
insertBefore
(
tag
,
firstScriptTag
);
$
(
"a#video-overlay-link"
).
click
(
function
(){
player
.
playVideo
();
$
(
"a.modal_close, #lean_overlay"
).
click
(
function
(){
player
.
pauseVideo
();
});
});
// TODO: Clean up as per http://stackoverflow.com/questions/169506/obtain-form-input-fields-using-jquery
/* Handles when the user hits 'enroll'. Grabs form data. Does AJAX.
...
...
@@ -89,7 +109,7 @@ $(function() {
});
})
/*$("sregion"+$("[id^=spinner_]")[1].id.substring(7)) */
});
</script>
video_init.js
View file @
30559f17
...
...
@@ -58,15 +58,23 @@ 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"
)){
function
toggleVideo
(){
if
(
$
(
"#video_control"
).
hasClass
(
"play"
)){
play
();
$
(
this
).
removeClass
().
addClass
(
"pause"
);
$
(
"#video_control"
).
removeClass
().
addClass
(
"pause"
);
}
else
{
pause
();
$
(
this
).
removeClass
().
addClass
(
"play"
);
$
(
"#video_control"
).
removeClass
().
addClass
(
"play"
);
}
}
$
(
"#video_control"
).
click
(
toggleVideo
);
// space bar to pause video
$
(
".video-wrapper"
).
keyup
(
function
(
e
){
active
=
document
.
activeElement
;
if
(
e
.
which
==
32
)
{
e
.
preventDefault
();
$
(
"#video_control"
).
click
();
}
});
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