Add hasCamera() method to flash camera detection
This commit is contained in:
committed by
Diana Huang
parent
53d376b611
commit
e498ad522a
@@ -58,6 +58,7 @@ package
|
||||
ExternalInterface.addCallback("reset", reset);
|
||||
ExternalInterface.addCallback("imageDataUrl", imageDataUrl);
|
||||
ExternalInterface.addCallback("cameraAuthorized", cameraAuthorized);
|
||||
ExternalInterface.addCallback("hasCamera", hasCamera);
|
||||
|
||||
// Notify the container that the SWF is ready to be called.
|
||||
ExternalInterface.call("setSWFIsReady");
|
||||
@@ -108,6 +109,10 @@ package
|
||||
return permissionGiven;
|
||||
}
|
||||
|
||||
public function hasCamera():Boolean {
|
||||
return (Camera.names.length != 0);
|
||||
}
|
||||
|
||||
public function statusHandler(event:StatusEvent):void {
|
||||
switch (event.code)
|
||||
{
|
||||
|
||||
Binary file not shown.
@@ -189,9 +189,11 @@ function initSnapshotHandler(names, hasHtml5CameraSupport) {
|
||||
}
|
||||
|
||||
function objectTagForFlashCamera(name) {
|
||||
// I manually update this to have ?v={2,3,4, etc} to avoid caching of flash
|
||||
// objects on local dev.
|
||||
return '<object type="application/x-shockwave-flash" id="' +
|
||||
name + '" name="' + name + '" data=' +
|
||||
'"/static/js/verify_student/CameraCapture.swf?v=2"' +
|
||||
'"/static/js/verify_student/CameraCapture.swf?v=3"' +
|
||||
'width="500" height="375"><param name="quality" ' +
|
||||
'value="high"><param name="allowscriptaccess" ' +
|
||||
'value="sameDomain"></object>';
|
||||
|
||||
Reference in New Issue
Block a user