gpt4 book ai didi

angularjs - 类型错误 : Cannot read property 'getSupportedConstraints' of undefined (when serve on host as IP address)

转载 作者:行者123 更新时间:2023-12-03 08:49:35 25 4
gpt4 key购买 nike

当我在本地主机上运行 angularjs 应用程序时,我遇到了有线问题,它工作正常。但是当我将其托管在 IP 地址上时,会出现错误

TypeError: Cannot read property 'getSupportedConstraints' of undefined

这是我的代码

let mediaSourceSupport = !!navigator.mediaDevices.getSupportedConstraints()
.mediaSource;

当在本地主机 navigator.mediaDevices 对象上提供服务时,我得到 http://prntscr.com/qpf32s但是当主机在 IP 地址上时,它会给出 undefind

最佳答案

您还可以启用 chrome://flags/#unsafely-treat-insecure-origin-as-secure 并向其中添加您的网址。

关于angularjs - 类型错误 : Cannot read property 'getSupportedConstraints' of undefined (when serve on host as IP address),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59799562/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com