Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
8839a205
Commit
8839a205
authored
11 years ago
by
Diana Huang
Browse files
Options
Downloads
Patches
Plain Diff
Wait until the flash object is loaded before looking for a camera.
parent
b8fcc118
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lms/static/js/verify_student/photocapture.js
+20
-7
20 additions, 7 deletions
lms/static/js/verify_student/photocapture.js
with
20 additions
and
7 deletions
lms/static/js/verify_student/photocapture.js
+
20
−
7
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
"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment