openvidu-browser: Safari fix for OverContrainedError on getUserMedia

pull/173/head
pabloFuente 2018-12-11 12:58:54 +01:00
parent 2a85971dfa
commit a75c3c194b
1 changed files with 8 additions and 0 deletions

View File

@ -480,6 +480,10 @@ export class Publisher extends StreamManager {
})
.catch(error => {
this.clearPermissionDialogTimer(startTime, timeForDialogEvent);
if (error.name === 'Error') {
// Safari OverConstrainedError has as name property 'Error' instead of 'OverConstrainedError'
error.name = error.constructor.name;
}
let errorName, errorMessage;
switch (error.name.toLowerCase()) {
case 'notfounderror':
@ -510,6 +514,10 @@ export class Publisher extends StreamManager {
})
.catch(error => {
this.clearPermissionDialogTimer(startTime, timeForDialogEvent);
if (error.name === 'Error') {
// Safari OverConstrainedError has as name property 'Error' instead of 'OverConstrainedError'
error.name = error.constructor.name;
}
let errorName, errorMessage;
switch (error.name.toLowerCase()) {
case 'notfounderror':