1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

sdp exchange.

This commit is contained in:
xiaozhihong 2020-03-30 15:16:29 +08:00
parent ccd170a813
commit 49da2099c1
12 changed files with 1435 additions and 298 deletions

View file

@ -70,15 +70,13 @@
$('#rtc_media_player').prop('srcObject', event.stream);
};
new Promise(function(resolve, reject) {
pc.addTransceiver("audio", {direction: "recvonly"});
pc.addTransceiver("video", {direction: "recvonly"});
pc.createOffer(function(offer){
resolve(offer);
},function(reason){
reject(reason);
},{
mandatory: {
OfferToReceiveAudio: true,
OfferToReceiveVideo: true
}
});
}).then(function(offer) {
return pc.setLocalDescription(offer).then(function(){ return offer; });