提交 8e8b524d authored 作者: Anthony Minessale's avatar Anthony Minessale 提交者: Mike Jerris

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

Conflicts:
	html5/verto/js/src/jquery.FSRTC.js
	html5/verto/video_demo-live_canvas/js/verto-min.js
	html5/verto/video_demo/js/verto-min.js
上级 399a95f7
This diff was suppressed by a .gitattributes entry.
...@@ -475,29 +475,16 @@ ...@@ -475,29 +475,16 @@
audio = false; audio = false;
} else { } else {
audio = { audio = {
//mandatory: {},
//optional: []
advanced: []
}; };
if (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};
} }
//FIXME
if (obj.options.audioParams) {
for (var key in obj.options.audioParams) {
var con = {};
//con[key] = obj.options.audioParams[key];
if (obj.options.audioParams[key]) {
con.exact = key;
audio.advanced.push(con);
}
}
}
} }
if (obj.options.useVideo && obj.options.localVideo) { if (obj.options.useVideo && obj.options.localVideo) {
...@@ -519,9 +506,20 @@ ...@@ -519,9 +506,20 @@
delete obj.options.videoParams.vertoBestFrameRate; delete obj.options.videoParams.vertoBestFrameRate;
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. if (!obj.options.useCamera && !!navigator.mozGetUserMedia) {
//This is an issue, only FireFox needs to ask this additional question if its screen or window we need a better way
var dowin = window.confirm("Do you want to share an application window? If not you can share an entire screen.");
video = {
width: {min: obj.options.videoParams.minWidth, max: obj.options.videoParams.maxWidth},
height: {min: obj.options.videoParams.minHeight, max: obj.options.videoParams.maxHeight},
mediaSource: dowin ? "window" : "screen"
}
} else {
var opt = []; var opt = [];
if (obj.options.useCamera) {
opt.push({sourceId: obj.options.useCamera}); opt.push({sourceId: obj.options.useCamera});
}
if (bestFrameRate) { if (bestFrameRate) {
opt.push({minFrameRate: bestFrameRate}); opt.push({minFrameRate: bestFrameRate});
...@@ -532,6 +530,7 @@ ...@@ -532,6 +530,7 @@
mandatory: obj.options.videoParams, mandatory: obj.options.videoParams,
optional: opt optional: opt
}; };
}
} else { } else {
video = { video = {
...@@ -588,6 +587,8 @@ ...@@ -588,6 +587,8 @@
if (screen) { if (screen) {
self.constraints.offerToReceiveVideo = false; self.constraints.offerToReceiveVideo = false;
self.constraints.offerToReceiveAudio = false;
self.constraints.offerToSendAudio = false;
} }
self.peer = FSRTCPeerConnection({ self.peer = FSRTCPeerConnection({
...@@ -638,6 +639,7 @@ ...@@ -638,6 +639,7 @@
onsuccess: onSuccess, onsuccess: onSuccess,
onerror: onError onerror: onError
}); });
} else { } else {
onSuccess(null); onSuccess(null);
} }
......
...@@ -1902,7 +1902,7 @@ ...@@ -1902,7 +1902,7 @@
useVideo: verto.options.useVideo, useVideo: verto.options.useVideo,
useStereo: verto.options.useStereo, useStereo: verto.options.useStereo,
screenShare: false, screenShare: false,
useCamera: verto.options.deviceParams.useCamera, useCamera: false,
useMic: verto.options.deviceParams.useMic, useMic: verto.options.deviceParams.useMic,
useSpeak: verto.options.deviceParams.useSpeak, useSpeak: verto.options.deviceParams.useSpeak,
tag: verto.options.tag, tag: verto.options.tag,
...@@ -1911,6 +1911,11 @@ ...@@ -1911,6 +1911,11 @@
videoParams: verto.options.videoParams videoParams: verto.options.videoParams
}, params); }, params);
if (!dialog.params.screenShare) {
dialog.params.useCamera = verto.options.deviceParams.useCamera;
}
dialog.verto = verto; dialog.verto = verto;
dialog.direction = direction; dialog.direction = direction;
dialog.lastState = null; dialog.lastState = null;
......
...@@ -886,22 +886,22 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora ...@@ -886,22 +886,22 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
} }
console.log('share screen from plugin'); console.log('share screen from plugin ' + storage.data.selectedShare);
getScreenId(function(error, sourceId, screen_constraints) { var screenfunc = function(error, sourceId, screen_constraints) {
if(error) { if(error) {
$rootScope.$emit('ScreenShareExtensionStatus', error); $rootScope.$emit('ScreenShareExtensionStatus', error);
return; return;
} }
var call = data.instance.newCall({ var share_call = data.instance.newCall({
destination_number: destination + '-screen', destination_number: destination + '-screen',
caller_id_name: data.name + ' (Screen)', caller_id_name: data.name + ' (Screen)',
caller_id_number: data.login + ' (Screen)', caller_id_number: data.login + ' (Screen)',
outgoingBandwidth: storage.data.outgoingBandwidth, outgoingBandwidth: storage.data.outgoingBandwidth,
incomingBandwidth: storage.data.incomingBandwidth, incomingBandwidth: storage.data.incomingBandwidth,
videoParams: screen_constraints.video.mandatory, videoParams: screen_constraints ? screen_constraints.video.mandatory : {},
useVideo: true, useVideo: true,
screenShare: true, screenShare: true,
dedEnc: storage.data.useDedenc, dedEnc: storage.data.useDedenc,
...@@ -913,7 +913,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora ...@@ -913,7 +913,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
}); });
// Override onStream callback in $.FSRTC instance // Override onStream callback in $.FSRTC instance
call.rtc.options.callbacks.onStream = function(rtc, stream) { share_call.rtc.options.callbacks.onStream = function(rtc, stream) {
if(stream) { if(stream) {
var StreamTrack = stream.getVideoTracks()[0]; var StreamTrack = stream.getVideoTracks()[0];
StreamTrack.addEventListener('ended', stopSharing); StreamTrack.addEventListener('ended', stopSharing);
...@@ -930,16 +930,19 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora ...@@ -930,16 +930,19 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
} }
}; };
data.shareCall = call; data.shareCall = share_call;
console.log('shareCall', data); console.log('shareCall', data);
data.mutedMic = false; data.mutedMic = false;
data.mutedVideo = false; data.mutedVideo = false;
};
that.refreshDevices(); if (!!navigator.mozGetUserMedia) {
screenfunc();
}); } else {
getScreenId(screenfunc);
}
}, },
......
This diff was suppressed by a .gitattributes entry.
...@@ -908,7 +908,7 @@ function doshare(on) { ...@@ -908,7 +908,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) {
...@@ -918,14 +918,21 @@ function doshare(on) { ...@@ -918,14 +918,21 @@ 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);
}
......
...@@ -2218,6 +2218,8 @@ SWITCH_STANDARD_APP(conference_function) ...@@ -2218,6 +2218,8 @@ SWITCH_STANDARD_APP(conference_function)
if (switch_channel_test_flag(channel, CF_VIDEO_ONLY)) { if (switch_channel_test_flag(channel, CF_VIDEO_ONLY)) {
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;
switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
switch_yield(100000); switch_yield(100000);
} }
} else { } else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论