Open thegobot opened 2 years ago
I was able to run in ff by modifying SDP I just put the video block at the beginning and the audio at the end of the SDP
workaround
let remoteSDP = json.sdp;
let remoteSDPForFF = "";
let startAudio = remoteSDP.match(/(m=audio)/);
let startVideo = remoteSDP.match(/(m=video)/);
if(startAudio && startVideo){
let audioBlock = remoteSDP.slice(startAudio.index, startVideo.index);
let videoBlock = remoteSDP.slice(startVideo.index);
remoteSDPForFF = remoteSDP.slice(0, startAudio.index);
remoteSDPForFF += videoBlock;
remoteSDPForFF += audioBlock;
}
It seems a bug introduced by yourself? So we can't replay it by Firefox only?
In this question, I don't know how you operate the "add track" function on PC corresponding to "publish". By default, SRS assumes that audio is added before video.
TRANS_BY_GPT3
The code above is a workaround You can make your own publish in FF
The fact is that FF(Win7) ignores the MID-N and determines the types in ascending order.
Description pc.setRemoteDescription(sdp).catch() Generate DOMException: Answer and offer have different media types at m-line 0
I noticed that Firefox puts the video media first (mid:0) in the SDP, then the audio (mid:1). SRS is the opposite, but the numbers are the same...
I found the line of code that generates this error https://github.com/mozilla/gecko-dev/blob/c12a59323ee46b29b90c9917a3a7a70ea714ffec/dom/media/webrtc/jsep/JsepSessionImpl.cpp#L1884
Start Mozilla Firefiox (ver 97, Windows 7)
createOffer()
send offer
Got answer from SRS
setRemoteDescription()
TRANS_BY_GPT3