我正在尝试使用react-native-webrtc创建一个基本的RN应用程序,但我无法创建RTCPeerConnection类实例。
import {RTCPeerConnection} from 'react-native-webrtc';
const App: () => React$Node = () => {
const configuration = { "iceServers": [{ "url": "stun:stun.l.google.com:19302" }] };
const pc = new RTCPeerConnection(configuration);
...
return(<>)
}
无法创建 RTCPeerConnection 类实例的原因可能是什么?所有依赖项均已安装。
注意,{ "url": ... } 已弃用,您应该使用 { "urls": ... } 代替。