FS-7746 #resolve this should work now
This commit is contained in:
parent
4582498b5e
commit
59d6e6323c
|
@ -468,6 +468,8 @@ var iceTimer;
|
||||||
}
|
}
|
||||||
|
|
||||||
var video = {};
|
var video = {};
|
||||||
|
var bestFrameRate = obj.options.videoParams.vertoBestFrameRate;
|
||||||
|
delete obj.options.videoParams.vertoBestFrameRate;
|
||||||
|
|
||||||
if (window.moz) {
|
if (window.moz) {
|
||||||
video = obj.options.videoParams;
|
video = obj.options.videoParams;
|
||||||
|
@ -478,15 +480,20 @@ var iceTimer;
|
||||||
video = {
|
video = {
|
||||||
mandatory: obj.options.videoParams,
|
mandatory: obj.options.videoParams,
|
||||||
optional: []
|
optional: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var useVideo = obj.options.useVideo;
|
var useVideo = obj.options.useVideo;
|
||||||
|
|
||||||
if (useVideo && obj.options.useCamera && obj.options.useCamera !== "none") {
|
if (useVideo && obj.options.useCamera && obj.options.useCamera !== "none") {
|
||||||
if (obj.options.useCamera !== "any") {
|
if (obj.options.useCamera !== "any") {
|
||||||
video.optional = [{sourceId: obj.options.useCamera}]
|
video.optional.push({sourceId: obj.options.useCamera});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bestFrameRate && !window.moz) {
|
||||||
|
video.optional.push({minFrameRate: bestFrameRate});
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
video = null;
|
video = null;
|
||||||
useVideo = null;
|
useVideo = null;
|
||||||
|
|
|
@ -40,8 +40,9 @@ function onError(e){onStreamError(self,e);}
|
||||||
var mediaParams=getMediaParams(self);console.log("Audio constraints",mediaParams.audio);console.log("Video constraints",mediaParams.video);if(self.options.useVideo&&self.options.localVideo){getUserMedia({constraints:{audio:false,video:{mandatory:self.options.videoParams,optional:[]},},localVideo:self.options.localVideo,onsuccess:function(e){self.options.localVideoStream=e;console.log("local video ready");},onerror:function(e){console.error("local video error!");}});}
|
var mediaParams=getMediaParams(self);console.log("Audio constraints",mediaParams.audio);console.log("Video constraints",mediaParams.video);if(self.options.useVideo&&self.options.localVideo){getUserMedia({constraints:{audio:false,video:{mandatory:self.options.videoParams,optional:[]},},localVideo:self.options.localVideo,onsuccess:function(e){self.options.localVideoStream=e;console.log("local video ready");},onerror:function(e){console.error("local video error!");}});}
|
||||||
getUserMedia({constraints:{audio:mediaParams.audio,video:mediaParams.video},video:mediaParams.useVideo,onsuccess:onSuccess,onerror:onError});};function getMediaParams(obj){var audio;if(obj.options.videoParams&&obj.options.screenShare){console.error("SCREEN SHARE");audio=false;}else{audio={mandatory:obj.options.audioParams,optional:[]};if(obj.options.useMic!=="any"){audio.optional=[{sourceId:obj.options.useMic}]}}
|
getUserMedia({constraints:{audio:mediaParams.audio,video:mediaParams.video},video:mediaParams.useVideo,onsuccess:onSuccess,onerror:onError});};function getMediaParams(obj){var audio;if(obj.options.videoParams&&obj.options.screenShare){console.error("SCREEN SHARE");audio=false;}else{audio={mandatory:obj.options.audioParams,optional:[]};if(obj.options.useMic!=="any"){audio.optional=[{sourceId:obj.options.useMic}]}}
|
||||||
if(obj.options.useVideo&&obj.options.localVideo){getUserMedia({constraints:{audio:false,video:{mandatory:obj.options.videoParams,optional:[]},},localVideo:obj.options.localVideo,onsuccess:function(e){self.options.localVideoStream=e;console.log("local video ready");},onerror:function(e){console.error("local video error!");}});}
|
if(obj.options.useVideo&&obj.options.localVideo){getUserMedia({constraints:{audio:false,video:{mandatory:obj.options.videoParams,optional:[]},},localVideo:obj.options.localVideo,onsuccess:function(e){self.options.localVideoStream=e;console.log("local video ready");},onerror:function(e){console.error("local video error!");}});}
|
||||||
var video={};if(window.moz){video=obj.options.videoParams;if(!video.width)video.width=video.minWidth;if(!video.height)video.height=video.minHeight;if(!video.frameRate)video.frameRate=video.minFrameRate;}else{video={mandatory:obj.options.videoParams,optional:[]}}
|
var video={};var bestFrameRate=obj.options.videoParams.vertoBestFrameRate;delete obj.options.videoParams.vertoBestFrameRate;if(window.moz){video=obj.options.videoParams;if(!video.width)video.width=video.minWidth;if(!video.height)video.height=video.minHeight;if(!video.frameRate)video.frameRate=video.minFrameRate;}else{video={mandatory:obj.options.videoParams,optional:[]}}
|
||||||
var useVideo=obj.options.useVideo;if(useVideo&&obj.options.useCamera&&obj.options.useCamera!=="none"){if(obj.options.useCamera!=="any"){video.optional=[{sourceId:obj.options.useCamera}]}}else{video=null;useVideo=null;}
|
var useVideo=obj.options.useVideo;if(useVideo&&obj.options.useCamera&&obj.options.useCamera!=="none"){if(obj.options.useCamera!=="any"){video.optional.push({sourceId:obj.options.useCamera});}
|
||||||
|
if(bestFrameRate&&!window.moz){video.optional.push({minFrameRate:bestFrameRate});}}else{video=null;useVideo=null;}
|
||||||
return{audio:audio,video:video,useVideo:useVideo};}
|
return{audio:audio,video:video,useVideo:useVideo};}
|
||||||
$.FSRTC.prototype.call=function(profile){checkCompat();var self=this;var screen=false;self.type="offer";if(self.options.videoParams&&self.options.screenShare){screen=true;}
|
$.FSRTC.prototype.call=function(profile){checkCompat();var self=this;var screen=false;self.type="offer";if(self.options.videoParams&&self.options.screenShare){screen=true;}
|
||||||
function onSuccess(stream){self.localStream=stream;self.peer=RTCPeerConnection({type:self.type,attachStream:self.localStream,onICE:function(candidate){return onICE(self,candidate);},onICEComplete:function(){return onICEComplete(self);},onRemoteStream:screen?function(stream){console.error("SKIP");}:function(stream){return onRemoteStream(self,stream);},onOfferSDP:function(sdp){return onOfferSDP(self,sdp);},onICESDP:function(sdp){return onICESDP(self,sdp);},onChannelError:function(e){return onChannelError(self,e);},constraints:self.constraints,iceServers:self.options.iceServers,});onStreamSuccess(self,stream);}
|
function onSuccess(stream){self.localStream=stream;self.peer=RTCPeerConnection({type:self.type,attachStream:self.localStream,onICE:function(candidate){return onICE(self,candidate);},onICEComplete:function(){return onICEComplete(self);},onRemoteStream:screen?function(stream){console.error("SKIP");}:function(stream){return onRemoteStream(self,stream);},onOfferSDP:function(sdp){return onOfferSDP(self,sdp);},onICESDP:function(sdp){return onICESDP(self,sdp);},onChannelError:function(e){return onChannelError(self,e);},constraints:self.constraints,iceServers:self.options.iceServers,});onStreamSuccess(self,stream);}
|
||||||
|
|
|
@ -179,7 +179,8 @@ function check_vid_res()
|
||||||
"minHeight": vid_height,
|
"minHeight": vid_height,
|
||||||
"maxWidth": vid_width,
|
"maxWidth": vid_width,
|
||||||
"maxHeight": vid_height,
|
"maxHeight": vid_height,
|
||||||
"minFrameRate": 30,
|
"minFrameRate": 15,
|
||||||
|
"vertoBestFrameRate": 30,
|
||||||
//chromeMediaSource: 'screen',
|
//chromeMediaSource: 'screen',
|
||||||
//mediaSource: 'screen'
|
//mediaSource: 'screen'
|
||||||
});
|
});
|
||||||
|
@ -1165,7 +1166,8 @@ function init() {
|
||||||
"minHeight": vid_height,
|
"minHeight": vid_height,
|
||||||
"maxWidth": vid_width,
|
"maxWidth": vid_width,
|
||||||
"maxHeight": vid_height,
|
"maxHeight": vid_height,
|
||||||
"minFrameRate": 30,
|
"minFrameRate": 15,
|
||||||
|
"vertoBestFrameRate": 30,
|
||||||
//chromeMediaSource: 'screen',
|
//chromeMediaSource: 'screen',
|
||||||
//mediaSource: 'screen'
|
//mediaSource: 'screen'
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue