Barcode Scanner, NotSupportedError: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV)

Hi

I was trying to implement Quaggajs to facilitate barcode scanner.

I use a HTML data type to hold access the camera and a button to trigger the user camera
the doctype is as below.

but then i get this error.
any idea how to solve it? the address is shown in the image above.

image

i had tried the following code in desk.html

<script>
var host  = "seratus.github.io";
if((host == window.location.host) && (window.location.protocol != "https:")){
window.location.protocol = "https:";
}
</script>

It work if i create another HTML file to test the barcode scanning.