提交 58b163e0 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-10360: [freeswitch-core,verto.js] FireFox Screen Sharing #resolve

上级 d99efb69
...@@ -479,15 +479,12 @@ ...@@ -479,15 +479,12 @@
if (obj.options.audioParams) { if (obj.options.audioParams) {
audio = obj.options.audioParams; audio = obj.options.audioParams;
} }
if (obj.options.useMic !== "any") { if (obj.options.useMic !== "any") {
//audio.optional = [{sourceId: obj.options.useMic}] //audio.optional = [{sourceId: obj.options.useMic}]
audio.deviceId = {exact: obj.options.useMic}; audio.deviceId = {exact: obj.options.useMic};
} }
} }
if (obj.options.useVideo && obj.options.localVideo) { if (obj.options.useVideo && obj.options.localVideo) {
...@@ -510,18 +507,28 @@ ...@@ -510,18 +507,28 @@
if (obj.options.screenShare) { if (obj.options.screenShare) {
// fix for chrome to work for now, will need to change once we figure out how to do this in a non-mandatory style constraint. // fix for chrome to work for now, will need to change once we figure out how to do this in a non-mandatory style constraint.
var opt = []; if (!!navigator.mozGetUserMedia) {
opt.push({sourceId: obj.options.useCamera}); var dowin = window.confirm("Do you want to share an application window? If not you will share a screen.");
if (bestFrameRate) { video = {
opt.push({minFrameRate: bestFrameRate}); width: {min: obj.options.videoParams.minWidth, max: obj.options.videoParams.maxWidth},
opt.push({maxFrameRate: bestFrameRate}); height: {min: obj.options.videoParams.minHeight, max: obj.options.videoParams.maxHeight},
mediaSource: dowin ? "window" : "screen"
}
} else {
var opt = [];
opt.push({sourceId: obj.options.useCamera});
if (bestFrameRate) {
opt.push({minFrameRate: bestFrameRate});
opt.push({maxFrameRate: bestFrameRate});
}
video = {
mandatory: obj.options.videoParams,
optional: opt
};
} }
video = {
mandatory: obj.options.videoParams,
optional: opt
};
} else { } else {
video = { video = {
...@@ -603,7 +610,7 @@ ...@@ -603,7 +610,7 @@
}, },
constraints: self.constraints, constraints: self.constraints,
iceServers: self.options.iceServers, iceServers: self.options.iceServers,
}); });     
onStreamSuccess(self, stream); onStreamSuccess(self, stream);
} }
...@@ -622,7 +629,7 @@ ...@@ -622,7 +629,7 @@
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.
This diff was suppressed by a .gitattributes entry.
...@@ -934,7 +934,7 @@ function doshare(on) { ...@@ -934,7 +934,7 @@ function doshare(on) {
console.log("Attempting Screen Capture...."); console.log("Attempting Screen Capture....");
getScreenId(function (error, sourceId, screen_constraints) { var sharefunc = function(error, sourceId, screen_constraints) {
...@@ -944,15 +944,22 @@ function doshare(on) { ...@@ -944,15 +944,22 @@ function doshare(on) {
caller_id_number: $("#cid").val() + " (screen)", caller_id_number: $("#cid").val() + " (screen)",
outgoingBandwidth: outgoingBandwidth, outgoingBandwidth: outgoingBandwidth,
incomingBandwidth: incomingBandwidth, incomingBandwidth: incomingBandwidth,
videoParams: screen_constraints.video.mandatory, videoParams: screen_constraints ? screen_constraints.video.mandatory : {},
useVideo: true, useVideo: true,
screenShare: true, screenShare: true,
dedEnc: $("#use_dedenc").is(':checked'), dedEnc: $("#use_dedenc").is(':checked'),
mirrorInput: $("#mirror_input").is(':checked') mirrorInput: $("#mirror_input").is(':checked')
}); });
}); };
if (!!navigator.mozGetUserMedia) {
sharefunc();
} else {
getScreenId(sharefunc);
}
//$("#main_info").html("Trying"); //$("#main_info").html("Trying");
......
...@@ -2381,6 +2381,10 @@ SWITCH_STANDARD_APP(conference_function) ...@@ -2381,6 +2381,10 @@ SWITCH_STANDARD_APP(conference_function)
if (switch_channel_test_flag(channel, CF_VIDEO_ONLY) || !switch_channel_test_flag(channel, CF_AUDIO)) { if (switch_channel_test_flag(channel, CF_VIDEO_ONLY) || !switch_channel_test_flag(channel, CF_AUDIO)) {
while(conference_utils_member_test_flag((&member), MFLAG_RUNNING) && switch_channel_ready(channel)) { while(conference_utils_member_test_flag((&member), MFLAG_RUNNING) && switch_channel_ready(channel)) {
switch_frame_t *read_frame;
if (switch_channel_test_flag(channel, CF_AUDIO)) {
switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
}
switch_yield(100000); switch_yield(100000);
} }
} else { } else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论