openvidu-browser 2.21.0-beta1 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/replace_for_ts44.sh +7 -0
- package/config/tsconfig.json +20 -0
- package/generate-docs.sh +1 -1
- package/lib/OpenVidu/Connection.d.ts +1 -1
- package/lib/OpenVidu/Connection.js +1 -1
- package/lib/OpenVidu/EventDispatcher.d.ts +8 -3
- package/lib/OpenVidu/EventDispatcher.js +18 -20
- package/lib/OpenVidu/EventDispatcher.js.map +1 -1
- package/lib/OpenVidu/Filter.js +11 -11
- package/lib/OpenVidu/Filter.js.map +1 -1
- package/lib/OpenVidu/LocalRecorder.d.ts +17 -7
- package/lib/OpenVidu/LocalRecorder.js +50 -47
- package/lib/OpenVidu/LocalRecorder.js.map +1 -1
- package/lib/OpenVidu/OpenVidu.d.ts +18 -4
- package/lib/OpenVidu/OpenVidu.js +143 -106
- package/lib/OpenVidu/OpenVidu.js.map +1 -1
- package/lib/OpenVidu/Publisher.d.ts +9 -14
- package/lib/OpenVidu/Publisher.js +59 -48
- package/lib/OpenVidu/Publisher.js.map +1 -1
- package/lib/OpenVidu/Session.d.ts +6 -29
- package/lib/OpenVidu/Session.js +93 -94
- package/lib/OpenVidu/Session.js.map +1 -1
- package/lib/OpenVidu/Stream.d.ts +2 -1
- package/lib/OpenVidu/Stream.js +80 -83
- package/lib/OpenVidu/Stream.js.map +1 -1
- package/lib/OpenVidu/StreamManager.d.ts +6 -15
- package/lib/OpenVidu/StreamManager.js +9 -32
- package/lib/OpenVidu/StreamManager.js.map +1 -1
- package/lib/OpenVidu/Subscriber.d.ts +1 -3
- package/lib/OpenVidu/Subscriber.js +4 -4
- package/lib/OpenVidu/Subscriber.js.map +1 -1
- package/lib/OpenViduInternal/Enums/LocalRecorderState.js +1 -1
- package/lib/OpenViduInternal/Enums/OpenViduError.js +1 -1
- package/lib/OpenViduInternal/Enums/TypeOfVideo.d.ts +6 -0
- package/lib/OpenViduInternal/Enums/TypeOfVideo.js +27 -0
- package/lib/OpenViduInternal/Enums/TypeOfVideo.js.map +1 -0
- package/lib/OpenViduInternal/Enums/VideoInsertMode.js +1 -1
- package/lib/OpenViduInternal/Events/ConnectionEvent.d.ts +3 -3
- package/lib/OpenViduInternal/Events/ConnectionEvent.js +6 -4
- package/lib/OpenViduInternal/Events/ConnectionEvent.js.map +1 -1
- package/lib/OpenViduInternal/Events/ConnectionPropertyChangedEvent.d.ts +2 -10
- package/lib/OpenViduInternal/Events/ConnectionPropertyChangedEvent.js +5 -11
- package/lib/OpenViduInternal/Events/ConnectionPropertyChangedEvent.js.map +1 -1
- package/lib/OpenViduInternal/Events/Event.js +1 -1
- package/lib/OpenViduInternal/Events/EventMap/EventMap.d.ts +5 -0
- package/lib/OpenViduInternal/Events/EventMap/EventMap.js +19 -0
- package/lib/OpenViduInternal/Events/EventMap/EventMap.js.map +1 -0
- package/lib/OpenViduInternal/Events/EventMap/PublisherEventMap.d.ts +47 -0
- package/lib/OpenViduInternal/Events/EventMap/PublisherEventMap.js +19 -0
- package/lib/OpenViduInternal/Events/EventMap/PublisherEventMap.js.map +1 -0
- package/lib/OpenViduInternal/Events/EventMap/SessionEventMap.d.ts +139 -0
- package/lib/OpenViduInternal/Events/EventMap/SessionEventMap.js +19 -0
- package/lib/OpenViduInternal/Events/EventMap/SessionEventMap.js.map +1 -0
- package/lib/OpenViduInternal/Events/EventMap/StreamManagerEventMap.d.ts +56 -0
- package/lib/OpenViduInternal/Events/EventMap/StreamManagerEventMap.js +19 -0
- package/lib/OpenViduInternal/Events/EventMap/StreamManagerEventMap.js.map +1 -0
- package/lib/OpenViduInternal/Events/ExceptionEvent.d.ts +1 -4
- package/lib/OpenViduInternal/Events/ExceptionEvent.js +4 -5
- package/lib/OpenViduInternal/Events/ExceptionEvent.js.map +1 -1
- package/lib/OpenViduInternal/Events/FilterEvent.js +3 -1
- package/lib/OpenViduInternal/Events/FilterEvent.js.map +1 -1
- package/lib/OpenViduInternal/Events/NetworkQualityLevelChangedEvent.d.ts +1 -4
- package/lib/OpenViduInternal/Events/NetworkQualityLevelChangedEvent.js +4 -5
- package/lib/OpenViduInternal/Events/NetworkQualityLevelChangedEvent.js.map +1 -1
- package/lib/OpenViduInternal/Events/PublisherSpeakingEvent.d.ts +3 -7
- package/lib/OpenViduInternal/Events/PublisherSpeakingEvent.js +6 -8
- package/lib/OpenViduInternal/Events/PublisherSpeakingEvent.js.map +1 -1
- package/lib/OpenViduInternal/Events/RecordingEvent.d.ts +3 -3
- package/lib/OpenViduInternal/Events/RecordingEvent.js +6 -4
- package/lib/OpenViduInternal/Events/RecordingEvent.js.map +1 -1
- package/lib/OpenViduInternal/Events/SessionDisconnectedEvent.d.ts +1 -1
- package/lib/OpenViduInternal/Events/SessionDisconnectedEvent.js +4 -2
- package/lib/OpenViduInternal/Events/SessionDisconnectedEvent.js.map +1 -1
- package/lib/OpenViduInternal/Events/SignalEvent.d.ts +1 -3
- package/lib/OpenViduInternal/Events/SignalEvent.js +4 -4
- package/lib/OpenViduInternal/Events/SignalEvent.js.map +1 -1
- package/lib/OpenViduInternal/Events/StreamEvent.d.ts +3 -3
- package/lib/OpenViduInternal/Events/StreamEvent.js +6 -4
- package/lib/OpenViduInternal/Events/StreamEvent.js.map +1 -1
- package/lib/OpenViduInternal/Events/StreamManagerEvent.d.ts +3 -9
- package/lib/OpenViduInternal/Events/StreamManagerEvent.js +6 -10
- package/lib/OpenViduInternal/Events/StreamManagerEvent.js.map +1 -1
- package/lib/OpenViduInternal/Events/StreamPropertyChangedEvent.d.ts +1 -3
- package/lib/OpenViduInternal/Events/StreamPropertyChangedEvent.js +4 -4
- package/lib/OpenViduInternal/Events/StreamPropertyChangedEvent.js.map +1 -1
- package/lib/OpenViduInternal/Events/VideoElementEvent.d.ts +3 -4
- package/lib/OpenViduInternal/Events/VideoElementEvent.js +6 -5
- package/lib/OpenViduInternal/Events/VideoElementEvent.js.map +1 -1
- package/lib/OpenViduInternal/Interfaces/Private/CustomMediaStreamConstraints.js +1 -1
- package/lib/OpenViduInternal/Interfaces/Private/IceServerProperties.d.ts +5 -0
- package/lib/OpenViduInternal/Interfaces/Private/IceServerProperties.js +3 -0
- package/lib/OpenViduInternal/Interfaces/Private/IceServerProperties.js.map +1 -0
- package/lib/OpenViduInternal/Interfaces/Private/InboundStreamOptions.d.ts +2 -1
- package/lib/OpenViduInternal/Interfaces/Private/InboundStreamOptions.js +1 -1
- package/lib/OpenViduInternal/Interfaces/Private/LocalConnectionOptions.d.ts +3 -0
- package/lib/OpenViduInternal/Interfaces/Private/LocalConnectionOptions.js +1 -1
- package/lib/OpenViduInternal/Interfaces/Private/OutboundStreamOptions.js +1 -1
- package/lib/OpenViduInternal/Interfaces/Private/RemoteConnectionOptions.js +1 -1
- package/lib/OpenViduInternal/Interfaces/Private/SessionOptions.js +1 -1
- package/lib/OpenViduInternal/Interfaces/Private/StreamOptionsServer.d.ts +2 -1
- package/lib/OpenViduInternal/Interfaces/Private/StreamOptionsServer.js +1 -1
- package/lib/OpenViduInternal/Interfaces/Public/Capabilities.js +1 -1
- package/lib/OpenViduInternal/Interfaces/Public/Device.js +1 -1
- package/lib/OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration.d.ts +3 -9
- package/lib/OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration.js +1 -1
- package/lib/OpenViduInternal/Interfaces/Public/PublisherProperties.d.ts +9 -0
- package/lib/OpenViduInternal/Interfaces/Public/PublisherProperties.js +1 -1
- package/lib/OpenViduInternal/Interfaces/Public/SignalOptions.js +1 -1
- package/lib/OpenViduInternal/Interfaces/Public/StreamManagerVideo.js +1 -1
- package/lib/OpenViduInternal/Interfaces/Public/SubscriberProperties.js +1 -1
- package/lib/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/jsonrpcclient.js +0 -3
- package/lib/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/jsonrpcclient.js.map +1 -1
- package/lib/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/transports/webSocketWithReconnection.js +11 -6
- package/lib/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/transports/webSocketWithReconnection.js.map +1 -1
- package/lib/OpenViduInternal/Logger/OpenViduLogger.js +13 -15
- package/lib/OpenViduInternal/Logger/OpenViduLogger.js.map +1 -1
- package/lib/OpenViduInternal/Utils/Platform.js.map +1 -1
- package/lib/OpenViduInternal/WebRtcPeer/WebRtcPeer.d.ts +5 -2
- package/lib/OpenViduInternal/WebRtcPeer/WebRtcPeer.js +187 -151
- package/lib/OpenViduInternal/WebRtcPeer/WebRtcPeer.js.map +1 -1
- package/lib/OpenViduInternal/WebRtcStats/WebRtcStats.js +6 -7
- package/lib/OpenViduInternal/WebRtcStats/WebRtcStats.js.map +1 -1
- package/lib/index.d.ts +7 -2
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/package.json +19 -8
- package/src/OpenVidu/Connection.ts +4 -4
- package/src/OpenVidu/EventDispatcher.ts +23 -16
- package/src/OpenVidu/Filter.ts +11 -11
- package/src/OpenVidu/LocalRecorder.ts +52 -54
- package/src/OpenVidu/OpenVidu.ts +151 -110
- package/src/OpenVidu/Publisher.ts +67 -53
- package/src/OpenVidu/Session.ts +91 -97
- package/src/OpenVidu/Stream.ts +64 -67
- package/src/OpenVidu/StreamManager.ts +12 -35
- package/src/OpenVidu/Subscriber.ts +2 -4
- package/src/OpenViduInternal/Enums/LocalRecorderState.ts +1 -1
- package/src/OpenViduInternal/Enums/OpenViduError.ts +1 -1
- package/src/OpenViduInternal/Enums/TypeOfVideo.ts +23 -0
- package/src/OpenViduInternal/Enums/VideoInsertMode.ts +1 -1
- package/src/OpenViduInternal/Events/ConnectionEvent.ts +4 -4
- package/src/OpenViduInternal/Events/ConnectionPropertyChangedEvent.ts +5 -13
- package/src/OpenViduInternal/Events/Event.ts +1 -1
- package/src/OpenViduInternal/Events/EventMap/EventMap.ts +21 -0
- package/src/OpenViduInternal/Events/EventMap/PublisherEventMap.ts +71 -0
- package/src/OpenViduInternal/Events/EventMap/SessionEventMap.ts +174 -0
- package/src/OpenViduInternal/Events/EventMap/StreamManagerEventMap.ts +81 -0
- package/src/OpenViduInternal/Events/ExceptionEvent.ts +2 -5
- package/src/OpenViduInternal/Events/FilterEvent.ts +1 -1
- package/src/OpenViduInternal/Events/NetworkQualityLevelChangedEvent.ts +2 -5
- package/src/OpenViduInternal/Events/PublisherSpeakingEvent.ts +4 -8
- package/src/OpenViduInternal/Events/RecordingEvent.ts +4 -4
- package/src/OpenViduInternal/Events/SessionDisconnectedEvent.ts +2 -2
- package/src/OpenViduInternal/Events/SignalEvent.ts +2 -4
- package/src/OpenViduInternal/Events/StreamEvent.ts +4 -4
- package/src/OpenViduInternal/Events/StreamManagerEvent.ts +4 -10
- package/src/OpenViduInternal/Events/StreamPropertyChangedEvent.ts +2 -4
- package/src/OpenViduInternal/Events/VideoElementEvent.ts +4 -5
- package/src/OpenViduInternal/Interfaces/Private/CustomMediaStreamConstraints.ts +1 -1
- package/src/OpenViduInternal/Interfaces/Private/IceServerProperties.ts +21 -0
- package/src/OpenViduInternal/Interfaces/Private/InboundStreamOptions.ts +3 -2
- package/src/OpenViduInternal/Interfaces/Private/LocalConnectionOptions.ts +5 -2
- package/src/OpenViduInternal/Interfaces/Private/OutboundStreamOptions.ts +1 -1
- package/src/OpenViduInternal/Interfaces/Private/RemoteConnectionOptions.ts +1 -1
- package/src/OpenViduInternal/Interfaces/Private/SessionOptions.ts +1 -1
- package/src/OpenViduInternal/Interfaces/Private/SignalOptions.ts +1 -1
- package/src/OpenViduInternal/Interfaces/Private/StreamOptionsServer.ts +3 -2
- package/src/OpenViduInternal/Interfaces/Public/Capabilities.ts +1 -1
- package/src/OpenViduInternal/Interfaces/Public/Device.ts +1 -1
- package/src/OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration.ts +5 -12
- package/src/OpenViduInternal/Interfaces/Public/PublisherProperties.ts +12 -2
- package/src/OpenViduInternal/Interfaces/Public/SignalOptions.ts +1 -1
- package/src/OpenViduInternal/Interfaces/Public/StreamManagerVideo.ts +1 -1
- package/src/OpenViduInternal/Interfaces/Public/SubscriberProperties.ts +1 -1
- package/src/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/jsonrpcclient.js +0 -5
- package/src/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/transports/webSocketWithReconnection.js +13 -7
- package/src/OpenViduInternal/Logger/OpenViduLogger.ts +1 -3
- package/src/OpenViduInternal/Utils/Platform.ts +1 -1
- package/src/OpenViduInternal/WebRtcPeer/WebRtcPeer.ts +233 -177
- package/src/OpenViduInternal/WebRtcStats/WebRtcStats.ts +2 -2
- package/src/index.ts +8 -2
- package/static/js/openvidu-browser-2.21.0.js +13140 -0
- package/static/js/openvidu-browser-2.21.0.min.js +1 -0
- package/static/js/openvidu-browser-2.21.0.min.js.map +1 -0
- package/ts4.4/lib/OpenVidu/Connection.d.ts +84 -0
- package/ts4.4/lib/OpenVidu/EventDispatcher.d.ts +43 -0
- package/ts4.4/lib/OpenVidu/Filter.d.ts +73 -0
- package/ts4.4/lib/OpenVidu/LocalRecorder.d.ts +97 -0
- package/ts4.4/lib/OpenVidu/OpenVidu.d.ts +256 -0
- package/ts4.4/lib/OpenVidu/Publisher.d.ts +138 -0
- package/ts4.4/lib/OpenVidu/Session.d.ts +381 -0
- package/ts4.4/lib/OpenVidu/Stream.d.ts +372 -0
- package/ts4.4/lib/OpenVidu/StreamManager.d.ts +154 -0
- package/ts4.4/lib/OpenVidu/Subscriber.d.ts +28 -0
- package/ts4.4/lib/OpenViduInternal/Enums/LocalRecorderState.d.ts +6 -0
- package/ts4.4/lib/OpenViduInternal/Enums/OpenViduError.d.ts +99 -0
- package/ts4.4/lib/OpenViduInternal/Enums/TypeOfVideo.d.ts +6 -0
- package/ts4.4/lib/OpenViduInternal/Enums/VideoInsertMode.d.ts +25 -0
- package/ts4.4/lib/OpenViduInternal/Events/ConnectionEvent.d.ts +34 -0
- package/ts4.4/lib/OpenViduInternal/Events/ConnectionPropertyChangedEvent.d.ts +34 -0
- package/ts4.4/lib/OpenViduInternal/Events/Event.d.ts +48 -0
- package/ts4.4/lib/OpenViduInternal/Events/EventMap/EventMap.d.ts +5 -0
- package/ts4.4/lib/OpenViduInternal/Events/EventMap/PublisherEventMap.d.ts +47 -0
- package/ts4.4/lib/OpenViduInternal/Events/EventMap/SessionEventMap.d.ts +138 -0
- package/ts4.4/lib/OpenViduInternal/Events/EventMap/StreamManagerEventMap.d.ts +56 -0
- package/ts4.4/lib/OpenViduInternal/Events/ExceptionEvent.d.ts +93 -0
- package/ts4.4/lib/OpenViduInternal/Events/FilterEvent.d.ts +19 -0
- package/ts4.4/lib/OpenViduInternal/Events/NetworkQualityLevelChangedEvent.d.ts +28 -0
- package/ts4.4/lib/OpenViduInternal/Events/PublisherSpeakingEvent.d.ts +27 -0
- package/ts4.4/lib/OpenViduInternal/Events/RecordingEvent.d.ts +40 -0
- package/ts4.4/lib/OpenViduInternal/Events/SessionDisconnectedEvent.d.ts +28 -0
- package/ts4.4/lib/OpenViduInternal/Events/SignalEvent.d.ts +34 -0
- package/ts4.4/lib/OpenViduInternal/Events/StreamEvent.d.ts +38 -0
- package/ts4.4/lib/OpenViduInternal/Events/StreamManagerEvent.d.ts +25 -0
- package/ts4.4/lib/OpenViduInternal/Events/StreamPropertyChangedEvent.d.ts +41 -0
- package/ts4.4/lib/OpenViduInternal/Events/VideoElementEvent.d.ts +21 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Private/CustomMediaStreamConstraints.d.ts +5 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Private/IceServerProperties.d.ts +5 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Private/InboundStreamOptions.d.ts +19 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Private/LocalConnectionOptions.d.ts +22 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Private/OutboundStreamOptions.d.ts +5 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Private/RemoteConnectionOptions.d.ts +7 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Private/SessionOptions.d.ts +5 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Private/StreamOptionsServer.d.ts +14 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Public/Capabilities.d.ts +21 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Public/Device.d.ts +17 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration.d.ts +50 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Public/PublisherProperties.d.ts +73 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Public/SignalOptions.d.ts +20 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Public/StreamManagerVideo.d.ts +35 -0
- package/ts4.4/lib/OpenViduInternal/Interfaces/Public/SubscriberProperties.d.ts +21 -0
- package/ts4.4/lib/OpenViduInternal/Logger/ConsoleLogger.d.ts +29 -0
- package/ts4.4/lib/OpenViduInternal/Logger/OpenViduLogger.d.ts +52 -0
- package/ts4.4/lib/OpenViduInternal/Logger/OpenViduLoggerConfiguration.d.ts +5 -0
- package/ts4.4/lib/OpenViduInternal/Utils/Platform.d.ts +98 -0
- package/ts4.4/lib/OpenViduInternal/WebRtcPeer/WebRtcPeer.d.ts +81 -0
- package/ts4.4/lib/OpenViduInternal/WebRtcStats/WebRtcStats.d.ts +70 -0
- package/ts4.4/lib/index.d.ts +39 -0
- package/config/typedoc.js +0 -30
- package/static/js/openvidu-browser-2.21.0-beta1.js +0 -12185
- package/static/js/openvidu-browser-2.21.0-beta1.min.js +0 -1
- package/static/js/openvidu-browser-2.21.0-beta1.min.js.map +0 -1
package/lib/OpenVidu/Session.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* (C) Copyright 2017-
|
|
3
|
+
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -23,6 +23,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
23
23
|
return extendStatics(d, b);
|
|
24
24
|
};
|
|
25
25
|
return function (d, b) {
|
|
26
|
+
if (typeof b !== "function" && b !== null)
|
|
27
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
26
28
|
extendStatics(d, b);
|
|
27
29
|
function __() { this.constructor = d; }
|
|
28
30
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -83,6 +85,14 @@ var OpenViduError_1 = require("../OpenViduInternal/Enums/OpenViduError");
|
|
|
83
85
|
var VideoInsertMode_1 = require("../OpenViduInternal/Enums/VideoInsertMode");
|
|
84
86
|
var OpenViduLogger_1 = require("../OpenViduInternal/Logger/OpenViduLogger");
|
|
85
87
|
var Platform_1 = require("../OpenViduInternal/Utils/Platform");
|
|
88
|
+
/**
|
|
89
|
+
* @hidden
|
|
90
|
+
*/
|
|
91
|
+
var semverMajor = require("semver/functions/major");
|
|
92
|
+
/**
|
|
93
|
+
* @hidden
|
|
94
|
+
*/
|
|
95
|
+
var semverMinor = require("semver/functions/minor");
|
|
86
96
|
/**
|
|
87
97
|
* @hidden
|
|
88
98
|
*/
|
|
@@ -96,24 +106,7 @@ var platform;
|
|
|
96
106
|
* Participants who publish their videos to a session can be seen by the rest of users connected to that specific session.
|
|
97
107
|
* Initialized with [[OpenVidu.initSession]] method.
|
|
98
108
|
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* - connectionCreated ([[ConnectionEvent]])
|
|
102
|
-
* - connectionDestroyed ([[ConnectionEvent]])
|
|
103
|
-
* - connectionPropertyChanged ([[ConnectionPropertyChangedEvent]]) <a href="https://docs.openvidu.io/en/stable/openvidu-pro/" target="_blank" style="display: inline-block; background-color: rgb(0, 136, 170); color: white; font-weight: bold; padding: 0px 5px; margin-right: 5px; border-radius: 3px; font-size: 13px; line-height:21px; font-family: Montserrat, sans-serif">PRO</a>
|
|
104
|
-
* - sessionDisconnected ([[SessionDisconnectedEvent]])
|
|
105
|
-
* - streamCreated ([[StreamEvent]])
|
|
106
|
-
* - streamDestroyed ([[StreamEvent]])
|
|
107
|
-
* - streamPropertyChanged ([[StreamPropertyChangedEvent]])
|
|
108
|
-
* - publisherStartSpeaking ([[PublisherSpeakingEvent]])
|
|
109
|
-
* - publisherStopSpeaking ([[PublisherSpeakingEvent]])
|
|
110
|
-
* - signal ([[SignalEvent]])
|
|
111
|
-
* - recordingStarted ([[RecordingEvent]])
|
|
112
|
-
* - recordingStopped ([[RecordingEvent]])
|
|
113
|
-
* - networkQualityLevelChanged ([[NetworkQualityLevelChangedEvent]])
|
|
114
|
-
* - reconnecting
|
|
115
|
-
* - reconnected
|
|
116
|
-
* - exception ([[ExceptionEvent]])
|
|
109
|
+
* See available event listeners at [[SessionEventMap]].
|
|
117
110
|
*/
|
|
118
111
|
var Session = /** @class */ (function (_super) {
|
|
119
112
|
__extends(Session, _super);
|
|
@@ -177,14 +170,12 @@ var Session = /** @class */ (function (_super) {
|
|
|
177
170
|
participantId: token,
|
|
178
171
|
metadata: !!metadata ? _this.stringClientMetadata(metadata) : ''
|
|
179
172
|
};
|
|
180
|
-
_this.connectAux(token)
|
|
181
|
-
resolve();
|
|
182
|
-
|
|
183
|
-
reject(error);
|
|
184
|
-
});
|
|
173
|
+
_this.connectAux(token)
|
|
174
|
+
.then(function () { return resolve(); })
|
|
175
|
+
.catch(function (error) { return reject(error); });
|
|
185
176
|
}
|
|
186
177
|
else {
|
|
187
|
-
reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.BROWSER_NOT_SUPPORTED, 'Browser ' + platform.getName() + ' (version ' + platform.getVersion() + ') for ' + platform.getFamily() + ' is not supported in OpenVidu'));
|
|
178
|
+
return reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.BROWSER_NOT_SUPPORTED, 'Browser ' + platform.getName() + ' (version ' + platform.getVersion() + ') for ' + platform.getFamily() + ' is not supported in OpenVidu'));
|
|
188
179
|
}
|
|
189
180
|
});
|
|
190
181
|
};
|
|
@@ -285,15 +276,15 @@ var Session = /** @class */ (function (_super) {
|
|
|
285
276
|
var _this = this;
|
|
286
277
|
return new Promise(function (resolve, reject) {
|
|
287
278
|
if (!_this.sessionConnected()) {
|
|
288
|
-
reject(_this.notConnectedError());
|
|
279
|
+
return reject(_this.notConnectedError());
|
|
289
280
|
}
|
|
290
281
|
var subscriber;
|
|
291
282
|
var callback = function (error) {
|
|
292
283
|
if (!!error) {
|
|
293
|
-
reject(error);
|
|
284
|
+
return reject(error);
|
|
294
285
|
}
|
|
295
286
|
else {
|
|
296
|
-
resolve(subscriber);
|
|
287
|
+
return resolve(subscriber);
|
|
297
288
|
}
|
|
298
289
|
};
|
|
299
290
|
if (!!properties) {
|
|
@@ -318,7 +309,7 @@ var Session = /** @class */ (function (_super) {
|
|
|
318
309
|
var _this = this;
|
|
319
310
|
return new Promise(function (resolve, reject) {
|
|
320
311
|
if (!_this.sessionConnected()) {
|
|
321
|
-
reject(_this.notConnectedError());
|
|
312
|
+
return reject(_this.notConnectedError());
|
|
322
313
|
}
|
|
323
314
|
else {
|
|
324
315
|
var connectionId_1 = subscriber.stream.connection.connectionId;
|
|
@@ -326,14 +317,14 @@ var Session = /** @class */ (function (_super) {
|
|
|
326
317
|
_this.openvidu.sendRequest('unsubscribeFromVideo', { sender: subscriber.stream.connection.connectionId }, function (error, response) {
|
|
327
318
|
if (error) {
|
|
328
319
|
logger.error('Error unsubscribing from ' + connectionId_1);
|
|
329
|
-
reject(error);
|
|
320
|
+
return reject(error);
|
|
330
321
|
}
|
|
331
322
|
else {
|
|
332
323
|
logger.info('Unsubscribed correctly from ' + connectionId_1);
|
|
333
324
|
subscriber.stream.streamManager.removeAllVideos();
|
|
334
325
|
subscriber.stream.disposeWebRtcPeer();
|
|
335
326
|
subscriber.stream.disposeMediaStream();
|
|
336
|
-
resolve();
|
|
327
|
+
return resolve();
|
|
337
328
|
}
|
|
338
329
|
});
|
|
339
330
|
}
|
|
@@ -356,7 +347,7 @@ var Session = /** @class */ (function (_super) {
|
|
|
356
347
|
var _this = this;
|
|
357
348
|
return new Promise(function (resolve, reject) {
|
|
358
349
|
if (!_this.sessionConnected()) {
|
|
359
|
-
reject(_this.notConnectedError());
|
|
350
|
+
return reject(_this.notConnectedError());
|
|
360
351
|
}
|
|
361
352
|
publisher.session = _this;
|
|
362
353
|
publisher.stream.session = _this;
|
|
@@ -366,11 +357,9 @@ var Session = /** @class */ (function (_super) {
|
|
|
366
357
|
publisher.stream.publish()
|
|
367
358
|
.then(function () {
|
|
368
359
|
_this.sendVideoData(publisher, 8, true, 5);
|
|
369
|
-
resolve();
|
|
360
|
+
return resolve();
|
|
370
361
|
})
|
|
371
|
-
.catch(function (error) {
|
|
372
|
-
reject(error);
|
|
373
|
-
});
|
|
362
|
+
.catch(function (error) { return reject(error); });
|
|
374
363
|
}
|
|
375
364
|
else {
|
|
376
365
|
// 'Session.unpublish(Publisher)' has been called. Must initialize again Publisher
|
|
@@ -381,14 +370,10 @@ var Session = /** @class */ (function (_super) {
|
|
|
381
370
|
publisher.stream.publish()
|
|
382
371
|
.then(function () {
|
|
383
372
|
_this.sendVideoData(publisher, 8, true, 5);
|
|
384
|
-
resolve();
|
|
373
|
+
return resolve();
|
|
385
374
|
})
|
|
386
|
-
.catch(function (error) {
|
|
387
|
-
|
|
388
|
-
});
|
|
389
|
-
}).catch(function (error) {
|
|
390
|
-
reject(error);
|
|
391
|
-
});
|
|
375
|
+
.catch(function (error) { return reject(error); });
|
|
376
|
+
}).catch(function (error) { return reject(error); });
|
|
392
377
|
}
|
|
393
378
|
});
|
|
394
379
|
};
|
|
@@ -419,17 +404,17 @@ var Session = /** @class */ (function (_super) {
|
|
|
419
404
|
}
|
|
420
405
|
var stream = publisher.stream;
|
|
421
406
|
if (!stream.connection) {
|
|
422
|
-
reject(new Error('The associated Connection object of this Publisher is null'));
|
|
407
|
+
return reject(new Error('The associated Connection object of this Publisher is null'));
|
|
423
408
|
}
|
|
424
409
|
else if (stream.connection !== _this.connection) {
|
|
425
|
-
reject(new Error('The associated Connection object of this Publisher is not your local Connection.' +
|
|
410
|
+
return reject(new Error('The associated Connection object of this Publisher is not your local Connection.' +
|
|
426
411
|
"Only moderators can force unpublish on remote Streams via 'forceUnpublish' method"));
|
|
427
412
|
}
|
|
428
413
|
else {
|
|
429
414
|
logger.info('Unpublishing local media (' + stream.connection.connectionId + ')');
|
|
430
415
|
_this.openvidu.sendRequest('unpublishVideo', function (error, response) {
|
|
431
416
|
if (error) {
|
|
432
|
-
reject(error);
|
|
417
|
+
return reject(error);
|
|
433
418
|
}
|
|
434
419
|
else {
|
|
435
420
|
logger.info('Media unpublished correctly');
|
|
@@ -441,7 +426,7 @@ var Session = /** @class */ (function (_super) {
|
|
|
441
426
|
var streamEvent = new StreamEvent_1.StreamEvent(true, publisher, 'streamDestroyed', publisher.stream, 'unpublish');
|
|
442
427
|
publisher.emitEvent('streamDestroyed', [streamEvent]);
|
|
443
428
|
streamEvent.callDefaultBehavior();
|
|
444
|
-
resolve();
|
|
429
|
+
return resolve();
|
|
445
430
|
}
|
|
446
431
|
});
|
|
447
432
|
}
|
|
@@ -468,22 +453,22 @@ var Session = /** @class */ (function (_super) {
|
|
|
468
453
|
var _this = this;
|
|
469
454
|
return new Promise(function (resolve, reject) {
|
|
470
455
|
if (!_this.sessionConnected()) {
|
|
471
|
-
reject(_this.notConnectedError());
|
|
456
|
+
return reject(_this.notConnectedError());
|
|
472
457
|
}
|
|
473
458
|
logger.info('Forcing disconnect for connection ' + connection.connectionId);
|
|
474
459
|
_this.openvidu.sendRequest('forceDisconnect', { connectionId: connection.connectionId }, function (error, response) {
|
|
475
460
|
if (error) {
|
|
476
461
|
logger.error('Error forcing disconnect for Connection ' + connection.connectionId, error);
|
|
477
462
|
if (error.code === 401) {
|
|
478
|
-
reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.OPENVIDU_PERMISSION_DENIED, "You don't have permissions to force a disconnection"));
|
|
463
|
+
return reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.OPENVIDU_PERMISSION_DENIED, "You don't have permissions to force a disconnection"));
|
|
479
464
|
}
|
|
480
465
|
else {
|
|
481
|
-
reject(error);
|
|
466
|
+
return reject(error);
|
|
482
467
|
}
|
|
483
468
|
}
|
|
484
469
|
else {
|
|
485
470
|
logger.info('Forcing disconnect correctly for Connection ' + connection.connectionId);
|
|
486
|
-
resolve();
|
|
471
|
+
return resolve();
|
|
487
472
|
}
|
|
488
473
|
});
|
|
489
474
|
});
|
|
@@ -507,22 +492,22 @@ var Session = /** @class */ (function (_super) {
|
|
|
507
492
|
var _this = this;
|
|
508
493
|
return new Promise(function (resolve, reject) {
|
|
509
494
|
if (!_this.sessionConnected()) {
|
|
510
|
-
reject(_this.notConnectedError());
|
|
495
|
+
return reject(_this.notConnectedError());
|
|
511
496
|
}
|
|
512
497
|
logger.info('Forcing unpublish for stream ' + stream.streamId);
|
|
513
498
|
_this.openvidu.sendRequest('forceUnpublish', { streamId: stream.streamId }, function (error, response) {
|
|
514
499
|
if (error) {
|
|
515
500
|
logger.error('Error forcing unpublish for Stream ' + stream.streamId, error);
|
|
516
501
|
if (error.code === 401) {
|
|
517
|
-
reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.OPENVIDU_PERMISSION_DENIED, "You don't have permissions to force an unpublishing"));
|
|
502
|
+
return reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.OPENVIDU_PERMISSION_DENIED, "You don't have permissions to force an unpublishing"));
|
|
518
503
|
}
|
|
519
504
|
else {
|
|
520
|
-
reject(error);
|
|
505
|
+
return reject(error);
|
|
521
506
|
}
|
|
522
507
|
}
|
|
523
508
|
else {
|
|
524
509
|
logger.info('Forcing unpublish correctly for Stream ' + stream.streamId);
|
|
525
|
-
resolve();
|
|
510
|
+
return resolve();
|
|
526
511
|
}
|
|
527
512
|
});
|
|
528
513
|
});
|
|
@@ -543,7 +528,7 @@ var Session = /** @class */ (function (_super) {
|
|
|
543
528
|
var _this = this;
|
|
544
529
|
return new Promise(function (resolve, reject) {
|
|
545
530
|
if (!_this.sessionConnected()) {
|
|
546
|
-
reject(_this.notConnectedError());
|
|
531
|
+
return reject(_this.notConnectedError());
|
|
547
532
|
}
|
|
548
533
|
var signalMessage = {};
|
|
549
534
|
if (signal.to && signal.to.length > 0) {
|
|
@@ -570,10 +555,10 @@ var Session = /** @class */ (function (_super) {
|
|
|
570
555
|
message: JSON.stringify(signalMessage)
|
|
571
556
|
}, function (error, response) {
|
|
572
557
|
if (!!error) {
|
|
573
|
-
reject(error);
|
|
558
|
+
return reject(error);
|
|
574
559
|
}
|
|
575
560
|
else {
|
|
576
|
-
resolve();
|
|
561
|
+
return resolve();
|
|
577
562
|
}
|
|
578
563
|
});
|
|
579
564
|
});
|
|
@@ -653,7 +638,7 @@ var Session = /** @class */ (function (_super) {
|
|
|
653
638
|
Session.prototype.off = function (type, handler) {
|
|
654
639
|
var _this = this;
|
|
655
640
|
var _a, _b, _c, _d;
|
|
656
|
-
_super.prototype.
|
|
641
|
+
_super.prototype.offAux.call(this, type, handler);
|
|
657
642
|
if (type === 'publisherStartSpeaking') {
|
|
658
643
|
// Check if Session object still has some listener for the event
|
|
659
644
|
if (!this.anySpeechEventListenerEnabled('publisherStartSpeaking', false)) {
|
|
@@ -937,28 +922,19 @@ var Session = /** @class */ (function (_super) {
|
|
|
937
922
|
* @hidden
|
|
938
923
|
*/
|
|
939
924
|
Session.prototype.recvIceCandidate = function (event) {
|
|
940
|
-
|
|
925
|
+
// The event contains fields that can be used to obtain a proper candidate,
|
|
926
|
+
// using the RTCIceCandidate constructor:
|
|
927
|
+
// https://w3c.github.io/webrtc-pc/#dom-rtcicecandidate-constructor
|
|
928
|
+
var candidateInit = {
|
|
941
929
|
candidate: event.candidate,
|
|
942
|
-
sdpMid: event.sdpMid,
|
|
943
930
|
sdpMLineIndex: event.sdpMLineIndex,
|
|
944
|
-
|
|
945
|
-
foundation: null,
|
|
946
|
-
port: null,
|
|
947
|
-
priority: null,
|
|
948
|
-
protocol: null,
|
|
949
|
-
relatedAddress: null,
|
|
950
|
-
relatedPort: null,
|
|
951
|
-
tcpType: null,
|
|
952
|
-
usernameFragment: null,
|
|
953
|
-
type: null,
|
|
954
|
-
toJSON: function () {
|
|
955
|
-
return { candidate: event.candidate };
|
|
956
|
-
}
|
|
931
|
+
sdpMid: event.sdpMid,
|
|
957
932
|
};
|
|
958
|
-
|
|
933
|
+
var iceCandidate = new RTCIceCandidate(candidateInit);
|
|
934
|
+
this.getConnection(event.senderConnectionId, 'Connection not found for connectionId ' + event.senderConnectionId + ' owning endpoint ' + event.endpointName + '. Ice candidate will be ignored: ' + iceCandidate)
|
|
959
935
|
.then(function (connection) {
|
|
960
936
|
var stream = connection.stream;
|
|
961
|
-
stream.getWebRtcPeer().addIceCandidate(
|
|
937
|
+
stream.getWebRtcPeer().addIceCandidate(iceCandidate).catch(function (error) {
|
|
962
938
|
logger.error('Error adding candidate for ' + stream.streamId
|
|
963
939
|
+ ' stream of endpoint ' + event.endpointName + ': ' + error);
|
|
964
940
|
});
|
|
@@ -1058,7 +1034,7 @@ var Session = /** @class */ (function (_super) {
|
|
|
1058
1034
|
// of the subscriber was already taking place. Always use the last one to retry the re-subscription
|
|
1059
1035
|
// process, as that SDP offer will be the only one available at the server side. Ignore previous ones
|
|
1060
1036
|
stream_1.reconnectionEventEmitter['onForciblyReconnectSubscriberLastEvent'] = event;
|
|
1061
|
-
reject('Ongoing forced subscriber reconnection');
|
|
1037
|
+
return reject('Ongoing forced subscriber reconnection');
|
|
1062
1038
|
}
|
|
1063
1039
|
else {
|
|
1064
1040
|
// One onForciblyReconnectSubscriber even has been received while a reconnection process
|
|
@@ -1081,17 +1057,17 @@ var Session = /** @class */ (function (_super) {
|
|
|
1081
1057
|
}
|
|
1082
1058
|
stream_1.completeWebRtcPeerReceive(true, true, event.sdpOffer)
|
|
1083
1059
|
.then(function () { return stream_1.finalResolveForSubscription(true, resolve); })
|
|
1084
|
-
.catch(function (error) { return stream_1.finalRejectForSubscription(true, "Error while forcibly reconnecting remote stream "
|
|
1060
|
+
.catch(function (error) { return stream_1.finalRejectForSubscription(true, "Error while forcibly reconnecting remote stream ".concat(event.streamId, ": ").concat(error.toString()), reject); });
|
|
1085
1061
|
}
|
|
1086
1062
|
else {
|
|
1087
1063
|
var errMsg = "No stream with streamId '" + event.streamId + "' found for connection '" + event.connectionId + "' on 'streamPropertyChanged' event";
|
|
1088
1064
|
logger.error(errMsg);
|
|
1089
|
-
reject(errMsg);
|
|
1065
|
+
return reject(errMsg);
|
|
1090
1066
|
}
|
|
1091
1067
|
})
|
|
1092
1068
|
.catch(function (openViduError) {
|
|
1093
1069
|
logger.error(openViduError);
|
|
1094
|
-
reject(openViduError);
|
|
1070
|
+
return reject(openViduError);
|
|
1095
1071
|
});
|
|
1096
1072
|
});
|
|
1097
1073
|
};
|
|
@@ -1137,7 +1113,7 @@ var Session = /** @class */ (function (_super) {
|
|
|
1137
1113
|
if (!this.connection.disposed && !forced) {
|
|
1138
1114
|
this.openvidu.sendRequest('leaveRoom', function (error, response) {
|
|
1139
1115
|
if (error) {
|
|
1140
|
-
logger.error("leaveRoom error: "
|
|
1116
|
+
logger.error("leaveRoom error: ".concat(JSON.stringify(error)));
|
|
1141
1117
|
}
|
|
1142
1118
|
_this.openvidu.closeWs();
|
|
1143
1119
|
});
|
|
@@ -1166,6 +1142,7 @@ var Session = /** @class */ (function (_super) {
|
|
|
1166
1142
|
token: (!!token) ? token : '',
|
|
1167
1143
|
session: this.sessionId,
|
|
1168
1144
|
platform: !!platform.getDescription() ? platform.getDescription() : 'unknown',
|
|
1145
|
+
sdkVersion: this.openvidu.libraryVersion,
|
|
1169
1146
|
metadata: !!this.options.metadata ? this.options.metadata : '',
|
|
1170
1147
|
secret: this.openvidu.getSecret(),
|
|
1171
1148
|
recorder: this.openvidu.getRecorder()
|
|
@@ -1290,13 +1267,13 @@ var Session = /** @class */ (function (_super) {
|
|
|
1290
1267
|
return new Promise(function (resolve, reject) {
|
|
1291
1268
|
_this.openvidu.startWs(function (error) {
|
|
1292
1269
|
if (!!error) {
|
|
1293
|
-
reject(error);
|
|
1270
|
+
return reject(error);
|
|
1294
1271
|
}
|
|
1295
1272
|
else {
|
|
1296
1273
|
var joinParams = _this.initializeParams(token);
|
|
1297
1274
|
_this.openvidu.sendRequest('joinRoom', joinParams, function (error, response) {
|
|
1298
1275
|
if (!!error) {
|
|
1299
|
-
reject(error);
|
|
1276
|
+
return reject(error);
|
|
1300
1277
|
}
|
|
1301
1278
|
else {
|
|
1302
1279
|
// Process join room response
|
|
@@ -1330,7 +1307,7 @@ var Session = /** @class */ (function (_super) {
|
|
|
1330
1307
|
events_1.streams.forEach(function (stream) {
|
|
1331
1308
|
_this.ee.emitEvent('streamCreated', [new StreamEvent_1.StreamEvent(false, _this, 'streamCreated', stream, '')]);
|
|
1332
1309
|
});
|
|
1333
|
-
resolve();
|
|
1310
|
+
return resolve();
|
|
1334
1311
|
}
|
|
1335
1312
|
});
|
|
1336
1313
|
}
|
|
@@ -1365,16 +1342,16 @@ var Session = /** @class */ (function (_super) {
|
|
|
1365
1342
|
var connection = _this.remoteConnections.get(connectionId);
|
|
1366
1343
|
if (!!connection) {
|
|
1367
1344
|
// Resolve remote connection
|
|
1368
|
-
resolve(connection);
|
|
1345
|
+
return resolve(connection);
|
|
1369
1346
|
}
|
|
1370
1347
|
else {
|
|
1371
1348
|
if (_this.connection.connectionId === connectionId) {
|
|
1372
1349
|
// Resolve local connection
|
|
1373
|
-
resolve(_this.connection);
|
|
1350
|
+
return resolve(_this.connection);
|
|
1374
1351
|
}
|
|
1375
1352
|
else {
|
|
1376
1353
|
// Connection not found. Reject with OpenViduError
|
|
1377
|
-
reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.GENERIC_ERROR, errorMessage));
|
|
1354
|
+
return reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.GENERIC_ERROR, errorMessage));
|
|
1378
1355
|
}
|
|
1379
1356
|
}
|
|
1380
1357
|
});
|
|
@@ -1385,13 +1362,13 @@ var Session = /** @class */ (function (_super) {
|
|
|
1385
1362
|
var connection = _this.remoteConnections.get(connectionId);
|
|
1386
1363
|
if (!!connection) {
|
|
1387
1364
|
// Resolve remote connection
|
|
1388
|
-
resolve(connection);
|
|
1365
|
+
return resolve(connection);
|
|
1389
1366
|
}
|
|
1390
1367
|
else {
|
|
1391
1368
|
// Remote connection not found. Reject with OpenViduError
|
|
1392
1369
|
var errorMessage = 'Remote connection ' + connectionId + " unknown when '" + operation + "'. " +
|
|
1393
1370
|
'Existing remote connections: ' + JSON.stringify(_this.remoteConnections.keys());
|
|
1394
|
-
reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.GENERIC_ERROR, errorMessage));
|
|
1371
|
+
return reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.GENERIC_ERROR, errorMessage));
|
|
1395
1372
|
}
|
|
1396
1373
|
});
|
|
1397
1374
|
};
|
|
@@ -1443,7 +1420,23 @@ var Session = /** @class */ (function (_super) {
|
|
|
1443
1420
|
};
|
|
1444
1421
|
Session.prototype.processJoinRoomResponse = function (opts) {
|
|
1445
1422
|
this.sessionId = opts.session;
|
|
1446
|
-
if (opts.
|
|
1423
|
+
if (opts.customIceServers != null && opts.customIceServers.length > 0) {
|
|
1424
|
+
this.openvidu.iceServers = [];
|
|
1425
|
+
for (var _i = 0, _a = opts.customIceServers; _i < _a.length; _i++) {
|
|
1426
|
+
var iceServer = _a[_i];
|
|
1427
|
+
var rtcIceServer = {
|
|
1428
|
+
urls: [iceServer.url]
|
|
1429
|
+
};
|
|
1430
|
+
logger.log("STUN/TURN server IP: " + iceServer.url);
|
|
1431
|
+
if (iceServer.username != null && iceServer.credential != null) {
|
|
1432
|
+
rtcIceServer.username = iceServer.username;
|
|
1433
|
+
rtcIceServer.credential = iceServer.credential;
|
|
1434
|
+
logger.log('TURN credentials [' + iceServer.username + ':' + iceServer.credential + ']');
|
|
1435
|
+
}
|
|
1436
|
+
this.openvidu.iceServers.push(rtcIceServer);
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
else if (opts.coturnIp != null && opts.coturnPort != null && opts.turnUsername != null && opts.turnCredential != null) {
|
|
1447
1440
|
var turnUrl1 = 'turn:' + opts.coturnIp + ':' + opts.coturnPort;
|
|
1448
1441
|
this.openvidu.iceServers = [
|
|
1449
1442
|
{ urls: [turnUrl1], username: opts.turnUsername, credential: opts.turnCredential }
|
|
@@ -1454,6 +1447,7 @@ var Session = /** @class */ (function (_super) {
|
|
|
1454
1447
|
this.openvidu.role = opts.role;
|
|
1455
1448
|
this.openvidu.finalUserId = opts.finalUserId;
|
|
1456
1449
|
this.openvidu.mediaServer = opts.mediaServer;
|
|
1450
|
+
this.openvidu.videoSimulcast = opts.videoSimulcast;
|
|
1457
1451
|
this.capabilities = {
|
|
1458
1452
|
subscribe: true,
|
|
1459
1453
|
publish: this.openvidu.role !== 'SUBSCRIBER',
|
|
@@ -1464,10 +1458,15 @@ var Session = /** @class */ (function (_super) {
|
|
|
1464
1458
|
if (opts.life != null) {
|
|
1465
1459
|
this.openvidu.life = opts.life;
|
|
1466
1460
|
}
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
'
|
|
1461
|
+
var minorDifference = semverMinor(opts.version) - semverMinor(this.openvidu.libraryVersion);
|
|
1462
|
+
if ((semverMajor(opts.version) !== semverMajor(this.openvidu.libraryVersion)) || !(minorDifference == 0 || minorDifference == 1)) {
|
|
1463
|
+
logger.error("openvidu-browser (".concat(this.openvidu.libraryVersion, ") and openvidu-server (").concat(opts.version, ") versions are incompatible. ")
|
|
1464
|
+
+ 'Errors are likely to occur. openvidu-browser SDK is only compatible with the same version or the immediately following minor version of an OpenVidu deployment');
|
|
1465
|
+
}
|
|
1466
|
+
else if (minorDifference == 1) {
|
|
1467
|
+
logger.warn("openvidu-browser version ".concat(this.openvidu.libraryVersion, " does not match openvidu-server version ").concat(opts.version, ". ")
|
|
1468
|
+
+ "These versions are still compatible with each other, but openvidu-browser version must be updated as soon as possible to ".concat(semverMajor(opts.version), ".").concat(semverMinor(opts.version), ".x. ")
|
|
1469
|
+
+ "This client using openvidu-browser ".concat(this.openvidu.libraryVersion, " will become incompatible with the next release of openvidu-server"));
|
|
1471
1470
|
}
|
|
1472
1471
|
};
|
|
1473
1472
|
return Session;
|