提交 0c6db6af authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-8180 fixed for real

上级 831ab39e
...@@ -102,26 +102,18 @@ ...@@ -102,26 +102,18 @@
if (moz) { if (moz) {
this.constraints = { this.constraints = {
offerToReceiveAudio: true offerToReceiveAudio: true,
offerToReceiveVideo: this.options.useVideo ? true : false,
}; };
if (this.options.useVideo) {
this.constraints.offerToReceiveVideo = true;
}
} else { } else {
this.constraints = { this.constraints = {
optional: [{ optional: [{
'DtlsSrtpKeyAgreement': 'true' 'DtlsSrtpKeyAgreement': 'true'
}],mandatory: { }],mandatory: {
OfferToReceiveAudio: true OfferToReceiveAudio: true,
OfferToReceiveVideo: this.options.useVideo ? true : false,
} }
}; };
if (this.options.useVideo) {
console.error(this.options.useVideo);
this.constraints.mandatory.OfferToReceiveVideo = true;
}
} }
if (self.options.useVideo) { if (self.options.useVideo) {
...@@ -149,9 +141,9 @@ ...@@ -149,9 +141,9 @@
self.options.useVideo = null; self.options.useVideo = null;
self.options.localVideo = null; self.options.localVideo = null;
if (moz) { if (moz) {
delete self.constraints.offerToReceiveVideo; self.constraints.offerToReceiveVideo = false;
} else { } else {
delete self.constraints.mandatory.OfferToReceiveVideo; self.constraints.mandatory.OfferToReceiveVideo = false;
} }
} }
...@@ -406,7 +398,6 @@ ...@@ -406,7 +398,6 @@
console.log("Audio constraints", mediaParams.audio); console.log("Audio constraints", mediaParams.audio);
console.log("Video constraints", mediaParams.video); console.log("Video constraints", mediaParams.video);
console.log("Device constraints", self.constraints);
if (self.options.useVideo && self.options.localVideo) { if (self.options.useVideo && self.options.localVideo) {
getUserMedia({ getUserMedia({
...@@ -511,8 +502,8 @@ ...@@ -511,8 +502,8 @@
} }
} else { } else {
video = null; video = false;
useVideo = null; useVideo = false;
} }
return {audio: audio, video: video, useVideo: useVideo}; return {audio: audio, video: video, useVideo: useVideo};
...@@ -535,9 +526,9 @@ ...@@ -535,9 +526,9 @@
if (screen) { if (screen) {
if (moz) { if (moz) {
delete self.constraints.OfferToReceiveVideo; self.constraints.OfferToReceiveVideo = false;
} else { } else {
delete self.constraints.mandatory.OfferToReceiveVideo; self.constraints.mandatory.OfferToReceiveVideo = false;
} }
} }
...@@ -577,12 +568,12 @@ ...@@ -577,12 +568,12 @@
console.log("Audio constraints", mediaParams.audio); console.log("Audio constraints", mediaParams.audio);
console.log("Video constraints", mediaParams.video); console.log("Video constraints", mediaParams.video);
console.log("Device constraints", self.constraints);
getUserMedia({ getUserMedia({
constraints: { constraints: {
audio: mediaParams.audio audio: mediaParams.audio,
//video: mediaParams.video video: mediaParams.video
}, },
video: mediaParams.useVideo, video: mediaParams.useVideo,
onsuccess: onSuccess, onsuccess: onSuccess,
......
This diff was suppressed by a .gitattributes entry.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论