提交 b79a7e18 authored 作者: Anthony Minessale's avatar Anthony Minessale

vid screen share placeholder --args --enable-usermedia-screen-capturing…

vid screen share placeholder --args --enable-usermedia-screen-capturing --usermedia-screen-capturing
上级 9ca115cf
...@@ -191,8 +191,8 @@ ...@@ -191,8 +191,8 @@
return true; return true;
} }
function onStreamError(self) { function onStreamError(self, e) {
console.log('There has been a problem retrieving the streams - did you allow access?'); console.log('There has been a problem retrieving the streams - did you allow access?', e);
} }
...@@ -332,19 +332,36 @@ ...@@ -332,19 +332,36 @@
onStreamSuccess(self); onStreamSuccess(self);
} }
function onError() { function onError(e) {
onStreamError(self); onStreamError(self, e);
} }
var audio;
if (this.options.videoParams && this.options.videoParams.chromeMediaSource == 'screen') {
this.options.videoParams = {
chromeMediaSource: 'screen',
maxWidth:screen.width,
maxHeight:screen.height
};
console.error("SCREEN SHARE");
audio = false;
} else {
audio = {
mandatory: this.options.audioParams,
optional: []
};
}
console.log("Mandatory audio constraints", this.options.audioParams); console.log("Mandatory audio constraints", this.options.audioParams);
console.log("Mandatory video constraints", this.options.videoParams); console.log("Mandatory video constraints", this.options.videoParams);
getUserMedia({ getUserMedia({
constraints: { constraints: {
audio: { audio: audio,
mandatory: this.options.audioParams,
optional: []
},
video: this.options.useVideo ? { video: this.options.useVideo ? {
mandatory: this.options.videoParams, mandatory: this.options.videoParams,
optional: [] optional: []
...@@ -395,19 +412,37 @@ ...@@ -395,19 +412,37 @@
onStreamSuccess(self); onStreamSuccess(self);
} }
function onError() { function onError(e) {
onStreamError(self); onStreamError(self, e);
} }
var audio;
if (this.options.videoParams && this.options.videoParams.chromeMediaSource == 'screen') {
this.options.videoParams = {
chromeMediaSource: 'screen',
maxWidth:screen.width,
maxHeight:screen.height
};
console.error("SCREEN SHARE");
audio = false;
} else {
audio = {
mandatory: this.options.audioParams,
optional: []
};
}
console.log("Mandatory audio constraints", this.options.audioParams); console.log("Mandatory audio constraints", this.options.audioParams);
console.log("Mandatory video constraints", this.options.videoParams); console.log("Mandatory video constraints", this.options.videoParams);
getUserMedia({ getUserMedia({
constraints: { constraints: {
audio: { audio: audio,
mandatory: this.options.audioParams,
optional: []
},
video: this.options.useVideo ? { video: this.options.useVideo ? {
mandatory: this.options.videoParams, mandatory: this.options.videoParams,
optional: [] optional: []
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论