angular7 - TypeError:无法读取未定义的属性“getUserMedia”
问题描述
我想在生产环境中的 Angular 应用程序中使用记录器服务。我使用 Angular 7。我想使用我的 IP 地址而不是 localhost 访问服务器。
我尝试使用与开发环境完美配合并使用 localhost 的代码,它使用 chrome 浏览器工作。
import {Component} from '@angular/core';
import MicRecorder from 'mic-recorder-to-mp3';
@Component({
selector: 'app-recorder',
templateUrl: './recorder.component.html',
styleUrls: ['./recorder.component.scss']
})
export class RecorderComponent {
recorder = new MicRecorder({
bitRate: 128,
audio: true,
});
constructor() {
}
start() {
this.recorder.start().then(() => {
}).catch((e) => {
console.error(e);
});
}
我在生产环境中使用相同的代码并使用 IP 地址而不是 localhost 时出现此错误
TypeError: Cannot read property 'getUserMedia' of undefined
解决方案
推荐阅读
- python-3.x - 如何从jsonschema,python3检查数组中的项目
- c++ - C ++ MFC:\ t后菜单中的快捷方式/加速器不出现
- javascript - Cors 策略错误:它没有 HTTP ok 状态
- spring - JWT 令牌的签名无效 - Azure + Spring Boot
- powerbi - 具有过滤值的未过滤值列表
- ios - 将 AVAudioSession 类别从播放更改为 playAndRecord
- javascript - 尽管部分和公用文件夹设置正确,但 CSS 仅加载两个 ejs 文件中的一个
- java - 安卓电视盒 HDMI 输入视频
- c# - Selenium c# 从网页中抓取信息
- python - Django如何识别连接已从客户端关闭