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
dbf088ae
Commit
dbf088ae
authored
Sep 12, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #944 from edx/diana/fix-camera-detection
Wait for flash to load before trying to detect a camera
parents
b8fcc118
8839a205
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 @
dbf088ae
...
@@ -230,6 +230,18 @@ function linkNewWindow(e) {
...
@@ -230,6 +230,18 @@ function linkNewWindow(e) {
e
.
preventDefault
();
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
()
{
$
(
document
).
ready
(
function
()
{
$
(
".carousel-nav"
).
addClass
(
'sr'
);
$
(
".carousel-nav"
).
addClass
(
'sr'
);
$
(
"#pay_button"
).
click
(
function
(){
$
(
"#pay_button"
).
click
(
function
(){
...
@@ -266,13 +278,14 @@ $(document).ready(function() {
...
@@ -266,13 +278,14 @@ $(document).ready(function() {
if
(
!
hasHtml5CameraSupport
)
{
if
(
!
hasHtml5CameraSupport
)
{
$
(
"#face_capture_div"
).
html
(
objectTagForFlashCamera
(
"face_flash"
));
$
(
"#face_capture_div"
).
html
(
objectTagForFlashCamera
(
"face_flash"
));
$
(
"#photo_id_capture_div"
).
html
(
objectTagForFlashCamera
(
"photo_id_flash"
));
$
(
"#photo_id_capture_div"
).
html
(
objectTagForFlashCamera
(
"photo_id_flash"
));
// wait for the flash object to be loaded
// wait for the flash object to be loaded and then check for a camera
// TODO: we need a better solution for this
if
(
browserHasFlash
())
{
setTimeout
(
function
()
{
waitForFlashLoad
(
function
(
flash_object
)
{
if
(
browserHasFlash
()
&&
!
$
(
'#face_flash'
)[
0
].
hasOwnProperty
(
'hasCamera'
))
{
if
(
!
flash_object
.
hasOwnProperty
(
'hasCamera'
)){
onVideoFail
(
'NO_DEVICES_FOUND'
);
onVideoFail
(
'NO_DEVICES_FOUND'
);
}
}
},
1000
);
},
$
(
'#face_flash'
)[
0
]);
}
}
}
analytics
.
pageview
(
"Capture Face Photo"
);
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