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
8839a205
Commit
8839a205
authored
Sep 12, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait until the flash object is loaded before looking for a camera.
parent
b8fcc118
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
lms/static/js/verify_student/photocapture.js
+20
-7
No files found.
lms/static/js/verify_student/photocapture.js
View file @
8839a205
...
...
@@ -230,6 +230,18 @@ function linkNewWindow(e) {
e
.
preventDefault
();
}
function
waitForFlashLoad
(
func
,
flash_object
)
{
if
(
!
flash_object
.
hasOwnProperty
(
'percentLoaded'
)
||
flash_object
.
percentLoaded
()
<
100
){
setTimeout
(
function
()
{
waitForFlashLoad
(
func
,
flash_object
);
},
50
);
}
else
{
func
(
flash_object
);
}
}
$
(
document
).
ready
(
function
()
{
$
(
".carousel-nav"
).
addClass
(
'sr'
);
$
(
"#pay_button"
).
click
(
function
(){
...
...
@@ -266,13 +278,14 @@ $(document).ready(function() {
if
(
!
hasHtml5CameraSupport
)
{
$
(
"#face_capture_div"
).
html
(
objectTagForFlashCamera
(
"face_flash"
));
$
(
"#photo_id_capture_div"
).
html
(
objectTagForFlashCamera
(
"photo_id_flash"
));
// wait for the flash object to be loaded
// TODO: we need a better solution for this
setTimeout
(
function
()
{
if
(
browserHasFlash
()
&&
!
$
(
'#face_flash'
)[
0
].
hasOwnProperty
(
'hasCamera'
))
{
onVideoFail
(
'NO_DEVICES_FOUND'
);
}
},
1000
);
// wait for the flash object to be loaded and then check for a camera
if
(
browserHasFlash
())
{
waitForFlashLoad
(
function
(
flash_object
)
{
if
(
!
flash_object
.
hasOwnProperty
(
'hasCamera'
)){
onVideoFail
(
'NO_DEVICES_FOUND'
);
}
},
$
(
'#face_flash'
)[
0
]);
}
}
analytics
.
pageview
(
"Capture Face Photo"
);
...
...
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