Merge branch 'master' of github.com:ZLMediaKit/ZLMediaKit

This commit is contained in:
xiongziliang 2022-03-12 19:28:02 +08:00
commit 2ff293e2e5
2 changed files with 20 additions and 14 deletions

View File

@ -7418,20 +7418,23 @@ var ZLMRTCClient = (function (exports) {
scaleResolutionDownBy: 4 scaleResolutionDownBy: 4
}]; }];
} }
if (this.options.audioEnable){
if (stream.getAudioTracks().length > 0) {
this.pc.addTransceiver(stream.getAudioTracks()[0], AudioTransceiverInit);
} else {
AudioTransceiverInit.direction = 'recvonly';
this.pc.addTransceiver('audio', AudioTransceiverInit);
}
}
if (stream.getAudioTracks().length > 0) { if (this.options.videoEnable){
this.pc.addTransceiver(stream.getAudioTracks()[0], AudioTransceiverInit);
} else {
AudioTransceiverInit.direction = 'recvonly';
this.pc.addTransceiver('audio', AudioTransceiverInit);
}
if (stream.getVideoTracks().length > 0) { if (stream.getVideoTracks().length > 0) {
this.pc.addTransceiver(stream.getVideoTracks()[0], VideoTransceiverInit); this.pc.addTransceiver(stream.getVideoTracks()[0], VideoTransceiverInit);
} else { } else {
VideoTransceiverInit.direction = 'recvonly'; VideoTransceiverInit.direction = 'recvonly';
this.pc.addTransceiver('video', VideoTransceiverInit); this.pc.addTransceiver('video', VideoTransceiverInit);
} }
}
/* /*
stream.getTracks().forEach((track,idx)=>{ stream.getTracks().forEach((track,idx)=>{
debug.log(this.TAG,track); debug.log(this.TAG,track);

View File

@ -7418,20 +7418,23 @@ var ZLMRTCClient = (function (exports) {
scaleResolutionDownBy: 4 scaleResolutionDownBy: 4
}]; }];
} }
if (this.options.audioEnable){
if (stream.getAudioTracks().length > 0) {
this.pc.addTransceiver(stream.getAudioTracks()[0], AudioTransceiverInit);
} else {
AudioTransceiverInit.direction = 'recvonly';
this.pc.addTransceiver('audio', AudioTransceiverInit);
}
}
if (stream.getAudioTracks().length > 0) { if (this.options.videoEnable){
this.pc.addTransceiver(stream.getAudioTracks()[0], AudioTransceiverInit);
} else {
AudioTransceiverInit.direction = 'recvonly';
this.pc.addTransceiver('audio', AudioTransceiverInit);
}
if (stream.getVideoTracks().length > 0) { if (stream.getVideoTracks().length > 0) {
this.pc.addTransceiver(stream.getVideoTracks()[0], VideoTransceiverInit); this.pc.addTransceiver(stream.getVideoTracks()[0], VideoTransceiverInit);
} else { } else {
VideoTransceiverInit.direction = 'recvonly'; VideoTransceiverInit.direction = 'recvonly';
this.pc.addTransceiver('video', VideoTransceiverInit); this.pc.addTransceiver('video', VideoTransceiverInit);
} }
}
/* /*
stream.getTracks().forEach((track,idx)=>{ stream.getTracks().forEach((track,idx)=>{
debug.log(this.TAG,track); debug.log(this.TAG,track);