小编Pat*_*k F的帖子

没有 Ice Candidates 聚集,peerConnection.iceGatheringState 立即返回“完成”

我已经被困在这个问题上有一段时间了。我的代码基于https://webrtc.org/getting-started/firebase-rtc-codelab。我基本上只是将其更改为 React 和 firebase 实时数据库而不是 firestore。

const VideoRoom = () => {
  const config = {
    apiKey: xxx,
    authDomain: xxx,
    databaseURL: xxx,
    projectId: xxx,
    storageBucket: xxx,
    messagingSenderId: xxx,
    appId: xxx,
  };

  const rtcconfig = {
    iceServers: [
      {
        urls: [
          "stun:stun1.l.google.com:19302",
          "stun:stun2.l.google.com:19302",
        ],
      },
    ],
    iceCandidatePoolSize: 10,
  };

  const { roomId } = useParams();

  if (!firebase.apps.length) {
    firebase.initializeApp(config);
  }

  const db = firebase.database();
  const rooms = () => db.ref("rooms");
  const room = (roomId) => db.ref(`rooms/${roomId}`);
  const callerCandidates = …
Run Code Online (Sandbox Code Playgroud)

webrtc firebase reactjs

3
推荐指数
1
解决办法
1800
查看次数

标签 统计

firebase ×1

reactjs ×1

webrtc ×1