小编Pal*_*dav的帖子

TypeError: Cannot read property 'getSupportedConstraints' of undefined (when serve on host as IP address)

I am facing a wired issue when i run my angularjs application on my localhost it is working fine. But when I host it on IP address it gives error

TypeError: Cannot read property 'getSupportedConstraints' of undefined

This is my code

let mediaSourceSupport = !!navigator.mediaDevices.getSupportedConstraints()
    .mediaSource;
Run Code Online (Sandbox Code Playgroud)

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

undefined navigator angularjs mediadevices

2
推荐指数
1
解决办法
1708
查看次数

标签 统计

angularjs ×1

mediadevices ×1

navigator ×1

undefined ×1