H5 error: Only secure origins are allowed when calling the user's computer camera.

this is the code that calls the user"s camera:

//
function getUserMedia(constraints, success, error) {
    if(navigator.mediaDevices.getUserMedia) {
        //API
        navigator.mediaDevices.getUserMedia(constraints).then(success).catch(error);
    } else if(navigator.webkitGetUserMedia) {
        //webkit
        navigator.webkitGetUserMedia(constraints, success, error)
    } else if(navigator.mozGetUserMedia) {
        //firfox
        navigator.mozGetUserMedia(constraints, success, error);
    } else if(navigator.getUserMedia) {
        //API
        navigator.getUserMedia(constraints, success, error);
    }
}

this is an error reported by the front console:
clipboard.png

what should the seniors do about it?

Mar.15,2021

you need a web page that uses https to call getUserMedia ()

for debugging, you can use localhost. (remember that if localhost allows you to call without https)


resolved.
in the background, flask, can add the ssl parameter when it starts.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5faa5-45861.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5faa5-45861.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?