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
c598b6de
Commit
c598b6de
authored
Jan 14, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logging has a timeout so it doesn't crash Chrome
parent
f0786bbe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
js/video_player.js
+8
-2
No files found.
js/video_player.js
View file @
c598b6de
...
@@ -3,12 +3,16 @@
...
@@ -3,12 +3,16 @@
var
close_event_logged
=
false
;
var
close_event_logged
=
false
;
function
log_close
()
{
function
log_close
()
{
var
d
=
new
Date
();
var
t
=
d
.
getTime
();
close_event_logged
=
"waiting"
;
close_event_logged
=
"waiting"
;
log_event
(
'page_close'
,
{});
log_event
(
'page_close'
,
{});
// Google Chrome will close without letting the event go through.
// Google Chrome will close without letting the event go through.
// This causes the page close to be delayed until we've hit the
// This causes the page close to be delayed until we've hit the
// server.
// server.
while
(
close_event_logged
!=
"done"
)
{
// TODO: Check what happens with no network.
while
((
close_event_logged
!=
"done"
)
&&
(
d
.
getTime
()
<
t
+
500
))
{
console
.
log
(
close_event_logged
);
}
}
}
}
...
@@ -220,8 +224,10 @@ function log_event(e, d) {
...
@@ -220,8 +224,10 @@ function log_event(e, d) {
"page"
:
document
.
URL
"page"
:
document
.
URL
},
},
function
(
data
)
{
function
(
data
)
{
console
.
log
(
"closing"
);
if
(
close_event_logged
==
"waiting"
)
{
if
(
close_event_logged
==
"waiting"
)
{
close_event_logged
==
"done"
;
close_event_logged
=
"done"
;
console
.
log
(
"closed"
);
}
}
});
});
}
}
...
...
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