Closed laowangnj closed 6 years ago
You can use the following snippet as base to create a connection between two nodes:
//Create offer
const offer = endpoint.createOffer({
audio : {
codecs : ["opus"],
extensions : ["urn:ietf:params:rtp-hdrext:ssrc-audio-level"]
},
video : {
codecs : ["vp8","vp9"],
rtx : true,
rtcpfbs : [
{ "id": "goog-remb"},
{ "id": "ccm", "params": ["fir"]},
{ "id": "nack"},
{ "id": "nack", "params": ["pli"]}
],
extensions : [ "urn:3gpp:video-orientation"]
}
});
//Send offer to sever
const joined = await tm.cmd("view",{
feedId : feedId,
sdp : offer.toString()
});
//parse answer
const answer = SemanticSDP.SDPInfo.process(joined.sdp);
//Create transport
const transport = endpoint.createTransport(offer, answer, {disableSTUNKeepAlive: true});
After that you can use the streams as you would normally do.
Need to test performance of the server, so how to use this as clients