Merge pull request #469 from mihailj/master

openvidu-browser: support screen sharing on Safari >= 13
pull/494/head
Carlos Santos 2020-05-15 11:16:24 +02:00 committed by GitHub
commit c9a5709852
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -366,6 +366,7 @@ export class OpenVidu {
*/
checkScreenSharingCapabilities(): number {
const browser = platform.name;
const version = platform?.version ? parseFloat(platform.version) : -1;
const family = platform.os!!.family;
// Reject mobile devices
@ -373,7 +374,8 @@ export class OpenVidu {
return 0;
}
if ((browser !== 'Chrome') && (browser !== 'Firefox') && (browser !== 'Opera') && (browser !== 'Electron')) {
if ((browser !== 'Chrome') && (browser !== 'Firefox') && (browser !== 'Opera') && (browser !== 'Electron') &&
(browser === 'Safari' && version < 13)) {
return 0;
} else {
return 1;
@ -758,7 +760,7 @@ export class OpenVidu {
// Screen sharing
if (!this.checkScreenSharingCapabilities()) {
const error = new OpenViduError(OpenViduErrorName.SCREEN_SHARING_NOT_SUPPORTED, 'You can only screen share in desktop Chrome, Firefox, Opera or Electron. Detected client: ' + platform.name);
const error = new OpenViduError(OpenViduErrorName.SCREEN_SHARING_NOT_SUPPORTED, 'You can only screen share in desktop Chrome, Firefox, Opera, Safari (>=13.0) or Electron. Detected client: ' + platform.name);
logger.error(error);
reject(error);
} else {
@ -812,7 +814,7 @@ export class OpenVidu {
} else {
if (navigator.mediaDevices['getDisplayMedia']) {
// getDisplayMedia support (Chrome >= 72, Firefox >= 66)
// getDisplayMedia support (Chrome >= 72, Firefox >= 66, Safari >= 13)
resolve(myConstraints);
} else {
// Default screen sharing extension for Chrome/Opera, or is Firefox < 66