小编Kim*_*g69的帖子

WEBRTC 视频聊天应用程序无法在不同网络中运行

我的视频聊天应用程序在同一网络中正常运行。它还使用 stun 生成并连接 IceCandidate。但由于某种原因,对等视频无法在不同的网络中播放。我在调试该问题时遇到问题。

我没有使用任何转弯服务器,但我怀疑这是问题,因为来自不同网络的对等点已经使用 stun 加入,只有视频无法播放

var socket= io('/')
var divVideoChatLobby = document.getElementById("video-chat-lobby")
var divVideoChat = document.getElementById("video-chat-room")
var joinButton = document.getElementById("join")
var userVideo = document.getElementById("user-video")
var peerVideo = document.getElementById("peer-video")
var roomInput = document.getElementById("roomName")
var roomname= roomInput.value
var rtcPeerConnection
var userStream

const iceServers = {
    iceServers:[
        {urls: "stun:stun.services.mozilla.com"},
        {urls: "stun:stun.l.google.com:19302"},
        {urls: "stun:stun1.l.google.com:19302"},
        {urls: "stun:stun3.l.google.com:19302"},
        {urls: "stun:stun4.l.google.com:19302"},
        {urls: "stun:stun.ekiga.net"},
     

    ]
}

userVideo.muted= "muted"
// var roomDiv = document.getElementById("room-div")
// roomDiv.style="display:none"
var creator=false

joinButton.addEventListener('click', function () {
    console.log('Room Name:', roomInput.value)
    if (roomInput.value …
Run Code Online (Sandbox Code Playgroud)

videochat stun node.js webrtc

4
推荐指数
1
解决办法
2493
查看次数

标签 统计

node.js ×1

stun ×1

videochat ×1

webrtc ×1