jiwenjiang/react-audio-analyser

生产环境 Cannot read property 'errorCallback' of undefined

Closed this issue · 10 comments

大神,在本地测试的时候,都是很正常的,但是上到生产环境后,点击开始录音,就一直报这个错误,请问大神知道可能是什么导致的吗?
1575001933899

这个是仿照你前面的示例代码写的
const audioProps = {
status,
backgroundColor: '#fff',
strokeColor: '#0060FF',
width: 216,
height: 40,
audioOptions: {
type: 'audio/mp3'
},
audioBitsPerSecond: 128000,
timeslice: 1000,
startCallback: (e) => {},
pauseCallback: (e) => {},
stopCallback: (e) => {},
onRecordCallback: (e) => {
this.setState({
period: period + 1
})
},
errorCallback: (err) => {
message.error(err);
}
};
只有这个地方有 errorCallback

不好意思啊,这个代码这么粘贴出来连缩进都没有了[Facepalm]

Got same error

Problem solved by switching http to https

Did you find the cause of this error?

Did you find the cause of this error?

because mic access required a secure connection (https).

生产环境 需要https