2018-04-26 15:33:47 +02:00
|
|
|
/*
|
2019-01-21 21:32:17 +01:00
|
|
|
* (C) Copyright 2017-2019 OpenVidu (https://openvidu.io/)
|
2018-04-26 15:33:47 +02:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-05-07 16:54:19 +02:00
|
|
|
/**
|
|
|
|
* Defines property [[OpenViduError.name]]
|
|
|
|
*/
|
2018-04-26 15:33:47 +02:00
|
|
|
export enum OpenViduErrorName {
|
2018-06-01 14:39:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Browser is not supported by OpenVidu.
|
2018-07-03 15:35:08 +02:00
|
|
|
* Returned upon unsuccessful [[Session.connect]]
|
2018-06-01 14:39:38 +02:00
|
|
|
*/
|
2018-04-26 15:33:47 +02:00
|
|
|
BROWSER_NOT_SUPPORTED = 'BROWSER_NOT_SUPPORTED',
|
2018-06-01 14:39:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The user hasn't granted permissions to the required input device when the browser asked for them.
|
2018-07-03 15:35:08 +02:00
|
|
|
* Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
|
2018-06-01 14:39:38 +02:00
|
|
|
*/
|
2018-05-30 12:24:18 +02:00
|
|
|
DEVICE_ACCESS_DENIED = 'DEVICE_ACCESS_DENIED',
|
2018-06-01 14:39:38 +02:00
|
|
|
|
2019-01-21 10:49:51 +01:00
|
|
|
/**
|
2019-01-25 13:12:47 +01:00
|
|
|
* The required input device is probably being used by other process when the browser asked for it.
|
|
|
|
* Accuracy of this property is only granted for Chrome and Firefox clients.
|
2019-01-21 10:49:51 +01:00
|
|
|
* Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
|
|
|
|
*/
|
|
|
|
DEVICE_ALREADY_IN_USE = "DEVICE_ALREADY_IN_USE",
|
|
|
|
|
2018-06-01 14:39:38 +02:00
|
|
|
/**
|
|
|
|
* The user hasn't granted permissions to capture some desktop screen when the browser asked for them.
|
2018-07-03 15:35:08 +02:00
|
|
|
* Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
|
2018-06-01 14:39:38 +02:00
|
|
|
*/
|
2018-04-26 15:33:47 +02:00
|
|
|
SCREEN_CAPTURE_DENIED = 'SCREEN_CAPTURE_DENIED',
|
2018-06-01 14:39:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Browser does not support screen sharing.
|
2018-07-03 15:35:08 +02:00
|
|
|
* Returned upon unsuccessful [[OpenVidu.initPublisher]]
|
2018-06-01 14:39:38 +02:00
|
|
|
*/
|
2018-04-26 15:33:47 +02:00
|
|
|
SCREEN_SHARING_NOT_SUPPORTED = 'SCREEN_SHARING_NOT_SUPPORTED',
|
2018-06-01 14:39:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Only for Chrome, there's no screen sharing extension installed
|
2018-07-03 15:35:08 +02:00
|
|
|
* Returned upon unsuccessful [[OpenVidu.initPublisher]]
|
2018-06-01 14:39:38 +02:00
|
|
|
*/
|
2018-04-26 15:33:47 +02:00
|
|
|
SCREEN_EXTENSION_NOT_INSTALLED = 'SCREEN_EXTENSION_NOT_INSTALLED',
|
2018-06-01 14:39:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Only for Chrome, the screen sharing extension is installed but is disabled
|
2018-07-03 15:35:08 +02:00
|
|
|
* Returned upon unsuccessful [[OpenVidu.initPublisher]]
|
2018-06-01 14:39:38 +02:00
|
|
|
*/
|
2018-04-26 15:33:47 +02:00
|
|
|
SCREEN_EXTENSION_DISABLED = 'SCREEN_EXTENSION_DISABLED',
|
2018-06-01 14:39:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* No video input device found with the provided deviceId (property [[PublisherProperties.videoSource]])
|
2018-07-03 15:35:08 +02:00
|
|
|
* Returned upon unsuccessful [[OpenVidu.initPublisher]]
|
2018-06-01 14:39:38 +02:00
|
|
|
*/
|
2018-04-26 15:33:47 +02:00
|
|
|
INPUT_VIDEO_DEVICE_NOT_FOUND = 'INPUT_VIDEO_DEVICE_NOT_FOUND',
|
2018-06-01 14:39:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* No audio input device found with the provided deviceId (property [[PublisherProperties.audioSource]])
|
2018-07-03 15:35:08 +02:00
|
|
|
* Returned upon unsuccessful [[OpenVidu.initPublisher]]
|
2018-06-01 14:39:38 +02:00
|
|
|
*/
|
2018-04-26 15:33:47 +02:00
|
|
|
INPUT_AUDIO_DEVICE_NOT_FOUND = 'INPUT_AUDIO_DEVICE_NOT_FOUND',
|
2018-06-01 14:39:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Method [[OpenVidu.initPublisher]] has been called with properties `videoSource` and `audioSource` of
|
|
|
|
* [[PublisherProperties]] parameter both set to *false* or *null*
|
|
|
|
*/
|
2018-04-26 15:33:47 +02:00
|
|
|
NO_INPUT_SOURCE_SET = 'NO_INPUT_SOURCE_SET',
|
2018-06-01 14:39:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Some media property of [[PublisherProperties]] such as `frameRate` or `resolution` is not supported
|
|
|
|
* by the input devices (whenever it is possible they are automatically adjusted to the most similar value).
|
2018-07-03 15:35:08 +02:00
|
|
|
* Returned upon unsuccessful [[OpenVidu.initPublisher]]
|
2018-06-01 14:39:38 +02:00
|
|
|
*/
|
2018-04-26 15:33:47 +02:00
|
|
|
PUBLISHER_PROPERTIES_ERROR = 'PUBLISHER_PROPERTIES_ERROR',
|
2018-06-01 14:39:38 +02:00
|
|
|
|
|
|
|
/**
|
2018-07-09 15:45:20 +02:00
|
|
|
* The client tried to call a method without the required permissions. This can occur for methods [[Session.publish]],
|
2018-08-28 11:24:26 +02:00
|
|
|
* [[Session.forceUnpublish]], [[Session.forceDisconnect]], [[Stream.applyFilter]], [[Stream.removeFilter]]
|
2018-06-01 14:39:38 +02:00
|
|
|
*/
|
2018-04-26 15:33:47 +02:00
|
|
|
OPENVIDU_PERMISSION_DENIED = 'OPENVIDU_PERMISSION_DENIED',
|
2018-06-01 14:39:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* _Not in use yet_
|
|
|
|
*/
|
2018-04-26 15:33:47 +02:00
|
|
|
OPENVIDU_NOT_CONNECTED = 'OPENVIDU_NOT_CONNECTED',
|
2018-06-01 14:39:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* _Not in use yet_
|
|
|
|
*/
|
2018-04-26 15:33:47 +02:00
|
|
|
GENERIC_ERROR = 'GENERIC_ERROR'
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Simple object to identify runtime errors on the client side
|
|
|
|
*/
|
|
|
|
export class OpenViduError {
|
|
|
|
|
|
|
|
name: OpenViduErrorName;
|
|
|
|
message: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @hidden
|
|
|
|
*/
|
|
|
|
constructor(name: OpenViduErrorName, message: string) {
|
|
|
|
this.name = name;
|
|
|
|
this.message = message;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|