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
026eb709
Commit
026eb709
authored
Feb 27, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Video player instrumented to see speeds
parent
60ac290b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
js/video_player.js
+12
-2
No files found.
js/video_player.js
View file @
026eb709
...
@@ -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