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
de6ce64b
Commit
de6ce64b
authored
Feb 28, 2012
by
Reda Lemeden
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
c69cd518
d2c1c795
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
css/application.css
+0
-0
js/video_player.js
+12
-2
No files found.
css/application.css
View file @
de6ce64b
This source diff could not be displayed because it is too large. You can
view the blob
instead.
js/video_player.js
View file @
de6ce64b
...
@@ -87,6 +87,7 @@ function change_video_speed(speed, youtube_id) {
...
@@ -87,6 +87,7 @@ function change_video_speed(speed, youtube_id) {
new_position
=
ytplayer
.
getCurrentTime
()
*
video_speed
/
speed
;
new_position
=
ytplayer
.
getCurrentTime
()
*
video_speed
/
speed
;
video_speed
=
speed
;
video_speed
=
speed
;
ytplayer
.
loadVideoById
(
youtube_id
,
new_position
);
ytplayer
.
loadVideoById
(
youtube_id
,
new_position
);
log_event
(
"speed"
,
{
"new_speed"
:
speed
,
"clip"
:
youtube_id
});
}
}
function
caption_at
(
index
)
{
function
caption_at
(
index
)
{
...
@@ -298,6 +299,7 @@ function onytplayerStateChange(newState) {
...
@@ -298,6 +299,7 @@ function onytplayerStateChange(newState) {
function
onPlayerError
(
errorCode
)
{
function
onPlayerError
(
errorCode
)
{
// alert("An error occured: " + errorCode);
// alert("An error occured: " + errorCode);
log_event
(
"player_error"
,
{
"error"
:
errorCode
});
}
}
// Currently duplicated to check for if video control changed by clicking the video for HTML5
// Currently duplicated to check for if video control changed by clicking the video for HTML5
...
@@ -349,6 +351,7 @@ function loadNewVideo(id, startSeconds) {
...
@@ -349,6 +351,7 @@ function loadNewVideo(id, startSeconds) {
catch
(
e
)
{
catch
(
e
)
{
window
[
'console'
].
log
(
JSON
.
stringify
(
e
));
window
[
'console'
].
log
(
JSON
.
stringify
(
e
));
}
}
log_event
(
"load_video"
,
{
"id"
:
id
,
"start"
:
startSeconds
});
//$("#slider").slider("option","value",startSeconds);
//$("#slider").slider("option","value",startSeconds);
//seekTo(startSeconds);
//seekTo(startSeconds);
}
}
...
@@ -363,18 +366,21 @@ function play() {
...
@@ -363,18 +366,21 @@ function play() {
if
(
ytplayer
)
{
if
(
ytplayer
)
{
ytplayer
.
playVideo
();
ytplayer
.
playVideo
();
}
}
log_event
(
"play_video"
,
{
"id"
:
getCurrentTime
(),
"code"
:
getEmbedCode
()});
}
}
function
pause
()
{
function
pause
()
{
if
(
ytplayer
)
{
if
(
ytplayer
)
{
ytplayer
.
pauseVideo
();
ytplayer
.
pauseVideo
();
}
}
log_event
(
"pause_video"
,
{
"id"
:
getCurrentTime
(),
"code"
:
getEmbedCode
()});
}
}
function
stop
()
{
function
stop
()
{
if
(
ytplayer
)
{
if
(
ytplayer
)
{
ytplayer
.
stopVideo
();
ytplayer
.
stopVideo
();
}
}
log_event
(
"stop_video"
,
{
"id"
:
getCurrentTime
(),
"code"
:
getEmbedCode
()});
}
}
function
getPlayerState
()
{
function
getPlayerState
()
{
...
@@ -426,11 +432,15 @@ function unMute() {
...
@@ -426,11 +432,15 @@ function unMute() {
}
}
function
getEmbedCode
()
{
function
getEmbedCode
()
{
alert
(
ytplayer
.
getVideoEmbedCode
());
if
(
ytplayer
)
{
ytplayer
.
getVideoEmbedCode
();
}
}
}
function
getVideoUrl
()
{
function
getVideoUrl
()
{
alert
(
ytplayer
.
getVideoUrl
());
if
(
ytplayer
)
{
ytplayer
.
getVideoUrl
();
}
}
}
function
setVolume
(
newVolume
)
{
function
setVolume
(
newVolume
)
{
...
...
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