我正在构建一个约会安排网络应用程序(类似于日历),它允许用户在某些时间点留下语音消息(解释),其他人可以在他们方便的时候远程检索。它在PC上运行良好,但我无法让它在手机上运行。显然,新的安全上下文标准已经到位(WebRTC?)并且必须提供安全上下文,但是尽管我使用的是 HTTPS(SSL 站点/域),但我无法让它在任何主要浏览器中工作。我还能如何提供这样的安全上下文?
我附上的代码非常流行并且过去运行良好(它仍然在笔记本电脑上运行!)。我该怎么做才能在手机(IOS、Android、平板电脑)上提供正确的上下文?感谢您的任何帮助。
navigator.mediaDevices.getUserMedia(constraints).then(function(stream) {
//console.log("getUserMedia() success, stream created, initializing Speakit_recorder.js ...");
audioContext = new AudioContext();
//update the format
/* assign to gumStream for later use */
gumStream = stream;
/* use the stream */
input = audioContext.createMediaStreamSource(stream);
/* Create the Recorder object, configure to record mono sound(1channel). Recording 2channels will double the file size */
rec = new Recorder(input,{numChannels:2})
//start the recording process
rec.record();
//console.log("Recording started");
}).catch(function(err) {
//do whatever is necesssary if getUserMedia() fails
});