今天在寫H5調用手機攝像頭時提示一個錯誤信息如下:
NotSupportedError Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).
[Deprecation] getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your
application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.
錯誤大概意思是說:
NotSupportedError僅允許安全起源(請參閱:https://goo.gl/Y0ZkNV)。
[Deprecation] getUserMedia()不再適用於不安全的起源。 要使用此功能,您應該考慮切換您的
應用程序到安全源,例如HTTPS。 有關詳細信息,請參閱https://goo.gl/rStTGz。
也就是說訪問的網頁地址必須是https開頭的鏈接不能是http。