webRTC插座.IO传输错误未知



我从套接字得到以下错误。io服务器。

"运输未知"

你能告诉我为什么会出现这个错误吗?

I使用此信令服务器连接。socketURL = 'https://rtcmulticonnection.herokuapp.com:443/';

我的代码以前是可以工作的,但是突然不能工作了。

使用此库实现webRTChttp://www.rtcmulticonnection.org/docs/

有谁能帮我一下吗?下面是我的代码
<script src="https://cdn.webrtc-experiment.com:443/rmc3.min.js"></script>
<script type="text/javascript">
    var Connection = new RTCMultiConnection();
    // or a free signaling server
    Connection.socketURL = 'https://rtcmulticonnection.herokuapp.com:443/';
    Connection.session = { 
        data: true,
        audio: true,
    };
    Connection.sdpConstraints.mandatory = {
        OfferToReceiveAudio: true,
        OfferToReceiveVideo: true
    };
    localvideoContainer = document.getElementById('meeting-preview');
    remotevideoContainer = document.getElementById('attendee-xylon');
    Connection.onstream = function(event){
        var video = event.mediaElement;
        console.log(event);
        if (event.type === 'local') {
            var userinfoDIV = document.createElement('div');
                userinfoDIV.className = 'user-video';
                userinfoDIV.innerHTML = '<video id="' + event.userid + '" src="' + URL.createObjectURL(event.stream) + '" autoplay muted=true volume=0></vide>' || '<img src="/frontend/images/meeting-preview.png" class="img-responsive" />';
            localvideoContainer.appendChild(userinfoDIV);
        };
        if (event.type === 'remote') {
            var userinfoDIV = document.createElement('div');
                userinfoDIV.id = event.userid;
                userinfoDIV.className = 'user-video meeting-attendees-content timer-icon';
                userinfoDIV.innerHTML = '<div id="remote"><video id="' + event.userid + '" src="' + URL.createObjectURL(event.stream) + '" autoplay muted=true volume=0></vide></div><button class="btn btn-custom" type="button" data-toggle="collapse" data-target="#collapse-one" aria-expanded="false" aria-controls="collapse-one">Show Goals / Progress</button><div class="collapse" id="collapse-one"><div class="well attendees-moreinfo"><div class="row"><div class="col-lg-12"><div class="personality-label week-goal"><span>1.</span> Here comes my defined goal for the week</div><div class="personality-bar"><div class="goal-bar-wrap"><div class="meter goal-progress nostripes"><span style="width: 66px; height: 4px;"></span></div></div></div><div class="personality-percentage text-right"><p>66%</p><p></p></div></div></div><div class="row"><div class="col-lg-12"><div class="personality-label week-goal"><span>2.</span> Here comes my defined goal for the week</div><div class="personality-bar"><div class="goal-bar-wrap"><div class="meter goal-progress nostripes"><span style="width: 50px; height: 4px;"></span></div></div></div><div class="personality-percentage text-right"><p>50%</p><p></p></div></div></div><div class="row"><div class="col-lg-12"><div class="personality-label week-goal"><span>3.</span> Here comes my defined goal for the week</div><div class="personality-bar"><div class="goal-bar-wrap"><div class="meter goal-progress nostripes"><span style="width: 80px; height: 4px;"></span></div></div></div><div class="personality-percentage text-right"><p>80%</p><p></p></div></div></div></div></div>' || '<img src="/frontend/images/meeting-preview.png" class="img-responsive" />';
            remotevideoContainer.appendChild(userinfoDIV);
        };
    }
    Connection.onclose = Connection.onleave = function(event) {
        console.log(event);
        $('#'+event.userid).hide();
    };
</script>
<script type="text/javascript">
    $(document).ready(function(){
        var url = window.location.pathname;
        Connection.openOrJoin(url.replace('/meetings/joinMeeting/',"") || 'predefined-roomid');
    });
</script>

请检查:

  • https://github.com/muaz-khan/RTCMultiConnection/releases/tag/3.4.2

最近的版本使用最新的socket.io.js,所以你被要求使用以下文件代替:

<script src="https://rtcmulticonnection.herokuapp.com/dist/RTCMultiConnection.min.js"></script>
<script src="https://rtcmulticonnection.herokuapp.com/socket.io/socket.io.js"></script>

请不要使用rmc3.min.js

最新更新