Use special JitsiTrackError object instead just strings for various types of errors that may happen to JitsiTrack

This commit is contained in:
tsareg 2016-05-25 15:04:48 +03:00
parent 064917886e
commit 48b219111d
2 changed files with 9 additions and 3 deletions

View File

@ -977,18 +977,21 @@ export default {
this.videoSwitchInProgress = false;
this.toggleScreenSharing(false);
if(err === TrackErrors.CHROME_EXTENSION_USER_CANCELED)
if (err.name === TrackErrors.CHROME_EXTENSION_USER_CANCELED) {
return;
}
console.error('failed to share local desktop', err);
if (err === TrackErrors.FIREFOX_EXTENSION_NEEDED) {
if (err.name === TrackErrors.FIREFOX_EXTENSION_NEEDED) {
APP.UI.showExtensionRequiredDialog(
config.desktopSharingFirefoxExtensionURL
);
return;
}
// TODO: handle Permission error
// Handling:
// TrackErrors.CHROME_EXTENSION_INSTALLATION_ERROR
// TrackErrors.GENERAL

View File

@ -36,7 +36,10 @@
};
navigator.webkitGetUserMedia({
audio: false, video: vid_constraint
}, callback, errorCallback);
}, callback, function (error) {
errorCallback &&
errorCallback(error, vid_constraint);
});
}
);
}