Commit 2ff293e2 by xiongziliang

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

parents b8277974 cc91f101
...@@ -7418,20 +7418,23 @@ var ZLMRTCClient = (function (exports) { ...@@ -7418,20 +7418,23 @@ var ZLMRTCClient = (function (exports) {
scaleResolutionDownBy: 4 scaleResolutionDownBy: 4
}]; }];
} }
if (this.options.audioEnable){
if (stream.getAudioTracks().length > 0) { if (stream.getAudioTracks().length > 0) {
this.pc.addTransceiver(stream.getAudioTracks()[0], AudioTransceiverInit); this.pc.addTransceiver(stream.getAudioTracks()[0], AudioTransceiverInit);
} else { } else {
AudioTransceiverInit.direction = 'recvonly'; AudioTransceiverInit.direction = 'recvonly';
this.pc.addTransceiver('audio', AudioTransceiverInit); this.pc.addTransceiver('audio', AudioTransceiverInit);
} }
}
if (this.options.videoEnable){
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);
......
...@@ -7418,20 +7418,23 @@ var ZLMRTCClient = (function (exports) { ...@@ -7418,20 +7418,23 @@ var ZLMRTCClient = (function (exports) {
scaleResolutionDownBy: 4 scaleResolutionDownBy: 4
}]; }];
} }
if (this.options.audioEnable){
if (stream.getAudioTracks().length > 0) { if (stream.getAudioTracks().length > 0) {
this.pc.addTransceiver(stream.getAudioTracks()[0], AudioTransceiverInit); this.pc.addTransceiver(stream.getAudioTracks()[0], AudioTransceiverInit);
} else { } else {
AudioTransceiverInit.direction = 'recvonly'; AudioTransceiverInit.direction = 'recvonly';
this.pc.addTransceiver('audio', AudioTransceiverInit); this.pc.addTransceiver('audio', AudioTransceiverInit);
} }
}
if (this.options.videoEnable){
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);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论