diff --git a/html5/verto/js/src/jquery.FSRTC.js b/html5/verto/js/src/jquery.FSRTC.js
index 303f9660b1..fcd300d185 100644
--- a/html5/verto/js/src/jquery.FSRTC.js
+++ b/html5/verto/js/src/jquery.FSRTC.js
@@ -468,6 +468,8 @@ var iceTimer;
}
var video = {};
+ var bestFrameRate = obj.options.videoParams.vertoBestFrameRate;
+ delete obj.options.videoParams.vertoBestFrameRate;
if (window.moz) {
video = obj.options.videoParams;
@@ -478,15 +480,20 @@ var iceTimer;
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}]
+ video.optional.push({sourceId: obj.options.useCamera});
}
+
+ if (bestFrameRate && !window.moz) {
+ video.optional.push({minFrameRate: bestFrameRate});
+ }
+
} else {
video = null;
useVideo = null;
diff --git a/html5/verto/video_demo/js/verto-min.js b/html5/verto/video_demo/js/verto-min.js
index 194df38936..4edb39ccea 100644
--- a/html5/verto/video_demo/js/verto-min.js
+++ b/html5/verto/video_demo/js/verto-min.js
@@ -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!");}});}
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!");}});}
-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 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 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.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};}
$.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);}
diff --git a/html5/verto/video_demo/verto.js b/html5/verto/video_demo/verto.js
index 89d28dc428..a35ceb2bbe 100644
--- a/html5/verto/video_demo/verto.js
+++ b/html5/verto/video_demo/verto.js
@@ -179,7 +179,8 @@ function check_vid_res()
"minHeight": vid_height,
"maxWidth": vid_width,
"maxHeight": vid_height,
- "minFrameRate": 30,
+ "minFrameRate": 15,
+ "vertoBestFrameRate": 30,
//chromeMediaSource: 'screen',
//mediaSource: 'screen'
});
@@ -1165,7 +1166,8 @@ function init() {
"minHeight": vid_height,
"maxWidth": vid_width,
"maxHeight": vid_height,
- "minFrameRate": 30,
+ "minFrameRate": 15,
+ "vertoBestFrameRate": 30,
//chromeMediaSource: 'screen',
//mediaSource: 'screen'
},