|
|
|
@ -256,12 +256,64 @@ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var splitShare = false; |
|
|
|
if (window.navigator.userAgent.match('Firefox')) { |
|
|
|
var ffver = parseInt(window.navigator.userAgent.match(/Firefox\/(.*)/)[1], 10); |
|
|
|
splitShare = (ffver >= 52); |
|
|
|
} |
|
|
|
|
|
|
|
// The parent CSS of the menu list items is using "display:block !important",
|
|
|
|
// so we need to also hide with "!important".
|
|
|
|
if (webrtc.getLocalScreen()) { |
|
|
|
$('#show-window-entry').attr('style','display:none !important'); |
|
|
|
$('#stop-screen-entry').show(); |
|
|
|
$('#screensharing-menu').toggleClass('open'); |
|
|
|
} else { |
|
|
|
if (splitShare) { |
|
|
|
$('#show-window-entry').show(); |
|
|
|
$('#stop-screen-entry').attr('style','display:none !important'); |
|
|
|
$('#screensharing-menu').toggleClass('open'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this.startShareScreen(); |
|
|
|
} |
|
|
|
}.bind(this)); |
|
|
|
|
|
|
|
$("#show-screen-button").on('click', function() { |
|
|
|
var webrtc = OCA.SpreedMe.webrtc; |
|
|
|
if (webrtc.getLocalScreen()) { |
|
|
|
var currentUser = OCA.SpreedMe.webrtc.connection.getSessionid(); |
|
|
|
OCA.SpreedMe.sharedScreens.switchScreenToId(currentUser); |
|
|
|
} else { |
|
|
|
this.startShareScreen('screen'); |
|
|
|
} |
|
|
|
|
|
|
|
$('#screensharing-menu').toggleClass('open', false); |
|
|
|
}.bind(this)); |
|
|
|
|
|
|
|
$("#show-window-button").on('click', function() { |
|
|
|
var webrtc = OCA.SpreedMe.webrtc; |
|
|
|
if (webrtc.getLocalScreen()) { |
|
|
|
var currentUser = OCA.SpreedMe.webrtc.connection.getSessionid(); |
|
|
|
OCA.SpreedMe.sharedScreens.switchScreenToId(currentUser); |
|
|
|
} else { |
|
|
|
var screensharingButton = $(this); |
|
|
|
this.startShareScreen('window'); |
|
|
|
} |
|
|
|
|
|
|
|
$('#screensharing-menu').toggleClass('open', false); |
|
|
|
}.bind(this)); |
|
|
|
|
|
|
|
$("#stop-screen-button").on('click', function() { |
|
|
|
OCA.SpreedMe.webrtc.stopScreenShare(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
startShareScreen: function(mode) { |
|
|
|
var webrtc = OCA.SpreedMe.webrtc; |
|
|
|
var screensharingButton = $('#screensharing-button'); |
|
|
|
screensharingButton.prop('disabled', true); |
|
|
|
webrtc.shareScreen(function(err) { |
|
|
|
webrtc.shareScreen(mode, function(err) { |
|
|
|
screensharingButton.prop('disabled', false); |
|
|
|
if (!err) { |
|
|
|
$('#screensharing-button').attr('data-original-title', t('spreed', 'Screensharing options')) |
|
|
|
@ -302,19 +354,6 @@ |
|
|
|
break; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
$("#show-screen-button").on('click', function() { |
|
|
|
var currentUser = OCA.SpreedMe.webrtc.connection.getSessionid(); |
|
|
|
OCA.SpreedMe.sharedScreens.switchScreenToId(currentUser); |
|
|
|
|
|
|
|
$('#screensharing-menu').toggleClass('open', false); |
|
|
|
}); |
|
|
|
|
|
|
|
$("#stop-screen-button").on('click', function() { |
|
|
|
OCA.SpreedMe.webrtc.stopScreenShare(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
_onKeyUp: function(event) { |
|
|
|
|