|
|
@@ -579,30 +579,9 @@ function _onCreateLocalTracksRejected({ gum }, device) {
|
|
579
|
579
|
const { error } = gum;
|
|
580
|
580
|
|
|
581
|
581
|
if (error) {
|
|
582
|
|
- // FIXME For whatever reason (which is probably an
|
|
583
|
|
- // implementation fault), react-native-webrtc will give the
|
|
584
|
|
- // error in one of the following formats depending on whether it
|
|
585
|
|
- // is attached to a remote debugger or not. (The remote debugger
|
|
586
|
|
- // scenario suggests that react-native-webrtc is at fault
|
|
587
|
|
- // because the remote debugger is Google Chrome and then its
|
|
588
|
|
- // JavaScript engine will define DOMException. I suspect I wrote
|
|
589
|
|
- // react-native-webrtc to return the error in the alternative
|
|
590
|
|
- // format if DOMException is not defined.)
|
|
591
|
|
- let trackPermissionError;
|
|
592
|
|
-
|
|
593
|
|
- switch (error.name) {
|
|
594
|
|
- case 'DOMException':
|
|
595
|
|
- trackPermissionError = error.message === 'NotAllowedError';
|
|
596
|
|
- break;
|
|
597
|
|
-
|
|
598
|
|
- case 'NotAllowedError':
|
|
599
|
|
- trackPermissionError = error instanceof DOMException;
|
|
600
|
|
- break;
|
|
601
|
|
- }
|
|
602
|
|
-
|
|
603
|
582
|
dispatch({
|
|
604
|
583
|
type: TRACK_CREATE_ERROR,
|
|
605
|
|
- permissionDenied: trackPermissionError,
|
|
|
584
|
+ permissionDenied: error.name === 'SecurityError',
|
|
606
|
585
|
trackType: device
|
|
607
|
586
|
});
|
|
608
|
587
|
}
|