Your client-side CFML code has encountered an initialization error.
- February 4, 2022
- 2 replies
- 426 views
Your client-side CFML code has encountered an initialization error. The required plugins cannot be loaded successfully within the timeout period.
i am facing this issue and not sure as to how i can fix this issue. i am using coldfusion 2021 standard edition and i am trying to access device camera using following code:
<html>
<head>
<title>camera camera. aa aa.</title>
<script type="text/javascript">
function src_to_img(img_id,data_to_write)
{
document.getElementById(img_id).src=data_to_write;
}
</script>
</head>
<body>
<cfclientsettings enableDeviceAPI=true>
<cfclient>
<cffunction access="public" name="getpiccam" returntype="void" verifyclient="Yes">
<cfset opt = cfclient.camera.getOptions()>
<cfset response = cfclient.camera.getPicture(opt,true)>
<cfset response ='data:image/jpeg;base64,'+ response>
<cfset src_to_img("myimg", response)>
</cffunction>
</cfclient>
<button style="width:100;height:50" onclick="invokeCFClientFunction('getpiccam',null,null)">Get a picture
</button>
<img style = "width:200; height:100;" id = "myimg"></img>
</body>
</html>
Attched is the error i get in browser console.


