Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- connection.onUserStatusChanged = function(event, dontWriteLogs) {
- if (!!connection.enableLogs && !dontWriteLogs) {
- console.info(event.userid, event.status);
- // connection.remove(event.userid);
- }
- };
- connection.onMediaError = function(error, constraints) {
- if (!!connection.enableLogs) {
- console.error(error, constraints);
- }
- /* handle the error */
- if (error.name=="NotFoundError" || error.name == "DevicesNotFoundError" ){
- //required track is missing
- alert('Нет доступа к камере!');
- } else if (error.name=="NotReadableError" || error.name == "TrackStartError" ){
- //webcam or mic are already in use
- alert('Веб-камера или микрофон уже используются!');
- } else if (error.name=="OverconstrainedError" || error.name == "ConstraintNotSatisfiedError" ){
- //constraints can not be satisfied by avb. devices
- alert('Камера не существует с этим разрешением!');
- } else if (error.name=="NotAllowedError" || error.name == "PermissionDeniedError" ){
- //permission denied in browser
- alert('Разрешение отклонено в браузере!');
- } else if (error.name=="TypeError" || error.name == "TypeError" ){
- //empty constraints object
- alert('Пустой объект ограничений!');
- } else {
- //other errors
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement