muaz-khan / RTCMultiConnection

RTCMultiConnection is a WebRTC JavaScript library for peer-to-peer applications (screen sharing, audio/video conferencing, file sharing, media streaming etc.)
https://muazkhan.com:9001/
MIT License
2.53k stars 1.37k forks source link

why webrtc connection fails #46

Open feng92f opened 9 years ago

feng92f commented 9 years ago

I find more and more "Peer connection is closed between you &" warning recently, i dont know what causes this error, and how to cut down the failures.

muaz-khan commented 9 years ago

Are you using v3.0? Then it'll be bandwidth issue. Simply replace this block with:

connection.processSdp = function(sdp) {
    sdp = BandwidthHandler.setApplicationSpecificBandwidth(sdp, connection.bandwidth, !!connection.session.screen);
    sdp = BandwidthHandler.setVideoBitrates(sdp, {
        min: 30,
        max: 50
    });
    sdp = BandwidthHandler.setOpusAttributes(sdp);
    return sdp;
};
feng92f commented 9 years ago

@muaz-khan thanks. i am using 3.0. I change it to this. but I want to know why the " min and max " could cause these annoying drop downs. and what can i do to shorten the blackout?

feng92f commented 9 years ago

@muaz-khan i doubt if it is my ISP who causes the cut downs. if I set intervals to reneogotiate, then i find no "closed peer connection errors".

imidimi commented 5 years ago

Are you using v3.0? Then it'll be bandwidth issue. Simply replace this block with:

connection.processSdp = function(sdp) {
    sdp = BandwidthHandler.setApplicationSpecificBandwidth(sdp, connection.bandwidth, !!connection.session.screen);
    sdp = BandwidthHandler.setVideoBitrates(sdp, {
        min: 30,
        max: 50
    });
    sdp = BandwidthHandler.setOpusAttributes(sdp);
    return sdp;
};

Which block it it? Can see the link. I m facing the same issue again and again

muaz-khan commented 5 years ago

processSdp documentation is here: https://www.rtcmulticonnection.org/docs/processSdp/

Here is the actual code that disables all kind of custom-encodings:

connection.processSdp = function(sdp) {
    return sdp;
};

Please remember to use a "well-deployed-and-configured" coturn server. Or OTHERWISE try to use xirsys' TURN servers for testing purpose. Because mostly disconnection happens on TURN-side.

sherinfathima925 commented 4 years ago

Are you using v3.0? Then it'll be bandwidth issue. Simply replace this block with:

connection.processSdp = function(sdp) {
    sdp = BandwidthHandler.setApplicationSpecificBandwidth(sdp, connection.bandwidth, !!connection.session.screen);
    sdp = BandwidthHandler.setVideoBitrates(sdp, {
        min: 30,
        max: 50
    });
    sdp = BandwidthHandler.setOpusAttributes(sdp);
    return sdp;
};

Which block it it? Can see the link. I m facing the same issue again and again

Are you using v3.0? Then it'll be bandwidth issue. Simply replace this block with:

connection.processSdp = function(sdp) {
    sdp = BandwidthHandler.setApplicationSpecificBandwidth(sdp, connection.bandwidth, !!connection.session.screen);
    sdp = BandwidthHandler.setVideoBitrates(sdp, {
        min: 30,
        max: 50
    });
    sdp = BandwidthHandler.setOpusAttributes(sdp);
    return sdp;
};

Which block it it? Can see the link. I m facing the same issue again and again

where can i add this line of code