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

This commit is contained in:
Anthony Minessale
2017-06-02 12:46:39 -05:00
parent b6a740a4cc
commit b4156f0984
3 changed files with 22 additions and 15 deletions

View File

@@ -885,22 +885,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) {
$rootScope.$emit('ScreenShareExtensionStatus', error);
return;
}
var call = data.instance.newCall({
var share_call = data.instance.newCall({
destination_number: destination + '-screen',
caller_id_name: data.name + ' (Screen)',
caller_id_number: data.login + ' (Screen)',
outgoingBandwidth: storage.data.outgoingBandwidth,
incomingBandwidth: storage.data.incomingBandwidth,
videoParams: screen_constraints.video.mandatory,
videoParams: screen_constraints ? screen_constraints.video.mandatory : {},
useVideo: true,
screenShare: true,
dedEnc: storage.data.useDedenc,
@@ -912,7 +912,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
});
// 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) {
var StreamTrack = stream.getVideoTracks()[0];
StreamTrack.addEventListener('ended', stopSharing);
@@ -929,16 +929,19 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
}
};
data.shareCall = call;
data.shareCall = share_call;
console.log('shareCall', data);
data.mutedMic = false;
data.mutedVideo = false;
};
that.refreshDevices();
});
if (!!navigator.mozGetUserMedia) {
screenfunc();
} else {
getScreenId(screenfunc);
}
},