openvidu-browser
Advanced tools
Comparing version 2.15.1-alpha2 to 2.15.1-beta1
@@ -22,2 +22,3 @@ module.exports = { | ||
excludePrivate: true, | ||
excludeProtected: true, | ||
excludeNotExported: true, | ||
@@ -24,0 +25,0 @@ theme: "default", |
@@ -24,2 +24,4 @@ export { OpenVidu } from './OpenVidu/OpenVidu'; | ||
export { FilterEvent } from './OpenViduInternal/Events/FilterEvent'; | ||
export { NetworkQualityChangedEvent } from './OpenViduInternal/Events/NetworkQualityChangedEvent'; | ||
export { NetworkQualityChangedReason } from './OpenViduInternal/Events/NetworkQualityChangedEvent'; | ||
export { Capabilities } from './OpenViduInternal/Interfaces/Public/Capabilities'; | ||
@@ -26,0 +28,0 @@ export { Device } from './OpenViduInternal/Interfaces/Public/Device'; |
@@ -49,4 +49,8 @@ "use strict"; | ||
exports.FilterEvent = FilterEvent_1.FilterEvent; | ||
var NetworkQualityChangedEvent_1 = require("./OpenViduInternal/Events/NetworkQualityChangedEvent"); | ||
exports.NetworkQualityChangedEvent = NetworkQualityChangedEvent_1.NetworkQualityChangedEvent; | ||
var NetworkQualityChangedEvent_2 = require("./OpenViduInternal/Events/NetworkQualityChangedEvent"); | ||
exports.NetworkQualityChangedReason = NetworkQualityChangedEvent_2.NetworkQualityChangedReason; | ||
var EventDispatcher_1 = require("./OpenVidu/EventDispatcher"); | ||
exports.EventDispatcher = EventDispatcher_1.EventDispatcher; | ||
//# sourceMappingURL=index.js.map |
@@ -658,3 +658,2 @@ "use strict"; | ||
heartbeat: 5000, | ||
sendCloseMessage: false, | ||
ws: { | ||
@@ -678,2 +677,3 @@ uri: this.wsUri, | ||
streamPropertyChanged: this.session.onStreamPropertyChanged.bind(this.session), | ||
networkQualityChanged: this.session.onNetworkQualityChangedChanged.bind(this.session), | ||
filterEventDispatched: this.session.onFilterEventDispatched.bind(this.session), | ||
@@ -916,14 +916,19 @@ iceCandidate: this.session.recvIceCandidate.bind(this.session), | ||
if (this.isRoomAvailable()) { | ||
this.sendRequest('connect', { sessionId: this.session.connection.rpcSessionId }, function (error, response) { | ||
if (!!error) { | ||
logger.error(error); | ||
logger.warn('Websocket was able to reconnect to OpenVidu Server, but your Connection was already destroyed due to timeout. You are no longer a participant of the Session and your media streams have been destroyed'); | ||
_this.session.onLostConnection("networkDisconnect"); | ||
_this.jsonRpcClient.close(4101, "Reconnection fault"); | ||
} | ||
else { | ||
_this.jsonRpcClient.resetPing(); | ||
_this.session.onRecoveredConnection(); | ||
} | ||
}); | ||
if (!!this.session.connection) { | ||
this.sendRequest('connect', { sessionId: this.session.connection.rpcSessionId }, function (error, response) { | ||
if (!!error) { | ||
logger.error(error); | ||
logger.warn('Websocket was able to reconnect to OpenVidu Server, but your Connection was already destroyed due to timeout. You are no longer a participant of the Session and your media streams have been destroyed'); | ||
_this.session.onLostConnection("networkDisconnect"); | ||
_this.jsonRpcClient.close(4101, "Reconnection fault"); | ||
} | ||
else { | ||
_this.jsonRpcClient.resetPing(); | ||
_this.session.onRecoveredConnection(); | ||
} | ||
}); | ||
} | ||
else { | ||
logger.warn('There was no previous connection when running reconnection callback'); | ||
} | ||
} | ||
@@ -930,0 +935,0 @@ else { |
@@ -20,2 +20,3 @@ import { Connection } from './Connection'; | ||
import { StreamEvent } from '../OpenViduInternal/Events/StreamEvent'; | ||
import { NetworkQualityChangedEvent } from '../OpenViduInternal/Events/NetworkQualityChangedEvent'; | ||
/** | ||
@@ -238,11 +239,11 @@ * Represents a video call. It can also be seen as a videoconference room where multiple users can connect. | ||
*/ | ||
on(type: string, handler: (event: SessionDisconnectedEvent | SignalEvent | StreamEvent | ConnectionEvent | PublisherSpeakingEvent | RecordingEvent) => void): EventDispatcher; | ||
on(type: string, handler: (event: SessionDisconnectedEvent | SignalEvent | StreamEvent | ConnectionEvent | PublisherSpeakingEvent | RecordingEvent | NetworkQualityChangedEvent) => void): EventDispatcher; | ||
/** | ||
* See [[EventDispatcher.once]] | ||
*/ | ||
once(type: string, handler: (event: SessionDisconnectedEvent | SignalEvent | StreamEvent | ConnectionEvent | PublisherSpeakingEvent | RecordingEvent) => void): Session; | ||
once(type: string, handler: (event: SessionDisconnectedEvent | SignalEvent | StreamEvent | ConnectionEvent | PublisherSpeakingEvent | RecordingEvent | NetworkQualityChangedEvent) => void): Session; | ||
/** | ||
* See [[EventDispatcher.off]] | ||
*/ | ||
off(type: string, handler?: (event: SessionDisconnectedEvent | SignalEvent | StreamEvent | ConnectionEvent | PublisherSpeakingEvent | RecordingEvent) => void): Session; | ||
off(type: string, handler?: (event: SessionDisconnectedEvent | SignalEvent | StreamEvent | ConnectionEvent | PublisherSpeakingEvent | RecordingEvent | NetworkQualityChangedEvent) => void): Session; | ||
/** | ||
@@ -279,2 +280,6 @@ * @hidden | ||
*/ | ||
onNetworkQualityChangedChanged(msg: any): void; | ||
/** | ||
* @hidden | ||
*/ | ||
recvIceCandidate(msg: any): void; | ||
@@ -281,0 +286,0 @@ /** |
@@ -43,2 +43,3 @@ "use strict"; | ||
var StreamPropertyChangedEvent_1 = require("../OpenViduInternal/Events/StreamPropertyChangedEvent"); | ||
var NetworkQualityChangedEvent_1 = require("../OpenViduInternal/Events/NetworkQualityChangedEvent"); | ||
var OpenViduError_1 = require("../OpenViduInternal/Enums/OpenViduError"); | ||
@@ -813,2 +814,10 @@ var VideoInsertMode_1 = require("../OpenViduInternal/Enums/VideoInsertMode"); | ||
*/ | ||
Session.prototype.onNetworkQualityChangedChanged = function (msg) { | ||
if (msg.connectionId === this.connection.connectionId) { | ||
this.ee.emitEvent('networkQualityChanged', [new NetworkQualityChangedEvent_1.NetworkQualityChangedEvent(this, msg.newValue, msg.oldValue, msg.reason)]); | ||
} | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
Session.prototype.recvIceCandidate = function (msg) { | ||
@@ -864,3 +873,3 @@ var candidate = { | ||
logger.warn('Lost connection in Session ' + this.sessionId); | ||
if (!!this.sessionId && !this.connection.disposed) { | ||
if (!!this.sessionId && !!this.connection && !this.connection.disposed) { | ||
this.leave(true, reason); | ||
@@ -867,0 +876,0 @@ } |
@@ -60,3 +60,8 @@ import { Connection } from './Connection'; | ||
/** | ||
* `"CAMERA"`, `"SCREEN"` or `"CUSTOM"` (the latter when [[PublisherProperties.videoSource]] is a MediaStreamTrack when calling [[OpenVidu.initPublisher]]). | ||
* Can be: | ||
* - `"CAMERA"`: when the video source comes from a webcam. | ||
* - `"SCREEN"`: when the video source comes from screen-sharing. | ||
* - `"CUSTOM"`: when [[PublisherProperties.videoSource]] has been initialized in the Publisher side with a custom MediaStreamTrack when calling [[OpenVidu.initPublisher]]). | ||
* - `"IPCAM"`: when the video source comes from an IP camera participant instead of a regular participant (see [IP cameras](/en/stable/advanced-features/ip-cameras/)). | ||
* | ||
* If [[hasVideo]] is false, this property is undefined | ||
@@ -63,0 +68,0 @@ */ |
@@ -179,14 +179,3 @@ var RpcBuilder = require('../'); | ||
enabledPings = false; | ||
if (configuration.sendCloseMessage) { | ||
Logger.debug("Sending close message"); | ||
this.send('closeSession', null, function (error, result) { | ||
if (error) { | ||
Logger.error("Error sending close message: " + JSON.stringify(error)); | ||
} | ||
ws.close(code, reason); | ||
}); | ||
} | ||
else { | ||
ws.close(code, reason); | ||
} | ||
ws.close(code, reason); | ||
}; | ||
@@ -193,0 +182,0 @@ this.forceClose = function (millis) { |
@@ -44,3 +44,3 @@ { | ||
"types": "lib/index.d.ts", | ||
"version": "2.15.1-alpha2" | ||
"version": "2.15.1-beta1" | ||
} |
@@ -26,2 +26,4 @@ export { OpenVidu } from './OpenVidu/OpenVidu'; | ||
export { FilterEvent } from './OpenViduInternal/Events/FilterEvent'; | ||
export { NetworkQualityChangedEvent } from './OpenViduInternal/Events/NetworkQualityChangedEvent'; | ||
export { NetworkQualityChangedReason } from './OpenViduInternal/Events/NetworkQualityChangedEvent'; | ||
@@ -28,0 +30,0 @@ export { Capabilities } from './OpenViduInternal/Interfaces/Public/Capabilities'; |
@@ -340,6 +340,6 @@ /* | ||
if(this.isIPhoneOrIPad(userAgent)) { | ||
if(this.isIOSWithSafari(userAgent) || platform['isIonicIos']){ | ||
return 1; | ||
} | ||
if (this.isIPhoneOrIPad(userAgent)) { | ||
if (this.isIOSWithSafari(userAgent) || platform['isIonicIos']) { | ||
return 1; | ||
} | ||
return 0; | ||
@@ -381,3 +381,3 @@ } | ||
if ((browser !== 'Chrome') && (browser !== 'Firefox') && (browser !== 'Opera') && (browser !== 'Electron') && | ||
(browser === 'Safari' && version < 13)) { | ||
(browser === 'Safari' && version < 13)) { | ||
return 0; | ||
@@ -764,3 +764,2 @@ } else { | ||
heartbeat: 5000, | ||
sendCloseMessage: false, | ||
ws: { | ||
@@ -784,2 +783,3 @@ uri: this.wsUri, | ||
streamPropertyChanged: this.session.onStreamPropertyChanged.bind(this.session), | ||
networkQualityChanged: this.session.onNetworkQualityChangedChanged.bind(this.session), | ||
filterEventDispatched: this.session.onFilterEventDispatched.bind(this.session), | ||
@@ -1032,13 +1032,17 @@ iceCandidate: this.session.recvIceCandidate.bind(this.session), | ||
if (this.isRoomAvailable()) { | ||
this.sendRequest('connect', { sessionId: this.session.connection.rpcSessionId }, (error, response) => { | ||
if (!!error) { | ||
logger.error(error); | ||
logger.warn('Websocket was able to reconnect to OpenVidu Server, but your Connection was already destroyed due to timeout. You are no longer a participant of the Session and your media streams have been destroyed'); | ||
this.session.onLostConnection("networkDisconnect"); | ||
this.jsonRpcClient.close(4101, "Reconnection fault"); | ||
} else { | ||
this.jsonRpcClient.resetPing(); | ||
this.session.onRecoveredConnection(); | ||
} | ||
}); | ||
if (!!this.session.connection) { | ||
this.sendRequest('connect', { sessionId: this.session.connection.rpcSessionId }, (error, response) => { | ||
if (!!error) { | ||
logger.error(error); | ||
logger.warn('Websocket was able to reconnect to OpenVidu Server, but your Connection was already destroyed due to timeout. You are no longer a participant of the Session and your media streams have been destroyed'); | ||
this.session.onLostConnection("networkDisconnect"); | ||
this.jsonRpcClient.close(4101, "Reconnection fault"); | ||
} else { | ||
this.jsonRpcClient.resetPing(); | ||
this.session.onRecoveredConnection(); | ||
} | ||
}); | ||
} else { | ||
logger.warn('There was no previous connection when running reconnection callback'); | ||
} | ||
} else { | ||
@@ -1072,5 +1076,5 @@ alert('Connection error. Please reload page.'); | ||
private isIOSWithSafari(userAgent): boolean{ | ||
private isIOSWithSafari(userAgent): boolean { | ||
return /\b(\w*Apple\w*)\b/.test(navigator.vendor) && /\b(\w*Safari\w*)\b/.test(userAgent) | ||
&& !/\b(\w*CriOS\w*)\b/.test(userAgent) && !/\b(\w*FxiOS\w*)\b/.test(userAgent); | ||
&& !/\b(\w*CriOS\w*)\b/.test(userAgent) && !/\b(\w*FxiOS\w*)\b/.test(userAgent); | ||
} | ||
@@ -1077,0 +1081,0 @@ |
@@ -40,2 +40,3 @@ /* | ||
import { StreamPropertyChangedEvent } from '../OpenViduInternal/Events/StreamPropertyChangedEvent'; | ||
import { NetworkQualityChangedEvent, NetworkQualityChangedReason } from '../OpenViduInternal/Events/NetworkQualityChangedEvent'; | ||
import { OpenViduError, OpenViduErrorName } from '../OpenViduInternal/Enums/OpenViduError'; | ||
@@ -595,3 +596,3 @@ import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode'; | ||
*/ | ||
on(type: string, handler: (event: SessionDisconnectedEvent | SignalEvent | StreamEvent | ConnectionEvent | PublisherSpeakingEvent | RecordingEvent) => void): EventDispatcher { | ||
on(type: string, handler: (event: SessionDisconnectedEvent | SignalEvent | StreamEvent | ConnectionEvent | PublisherSpeakingEvent | RecordingEvent | NetworkQualityChangedEvent) => void): EventDispatcher { | ||
@@ -628,3 +629,3 @@ super.onAux(type, "Event '" + type + "' triggered by 'Session'", handler); | ||
*/ | ||
once(type: string, handler: (event: SessionDisconnectedEvent | SignalEvent | StreamEvent | ConnectionEvent | PublisherSpeakingEvent | RecordingEvent) => void): Session { | ||
once(type: string, handler: (event: SessionDisconnectedEvent | SignalEvent | StreamEvent | ConnectionEvent | PublisherSpeakingEvent | RecordingEvent | NetworkQualityChangedEvent) => void): Session { | ||
@@ -661,3 +662,3 @@ super.onceAux(type, "Event '" + type + "' triggered once by 'Session'", handler); | ||
*/ | ||
off(type: string, handler?: (event: SessionDisconnectedEvent | SignalEvent | StreamEvent | ConnectionEvent | PublisherSpeakingEvent | RecordingEvent) => void): Session { | ||
off(type: string, handler?: (event: SessionDisconnectedEvent | SignalEvent | StreamEvent | ConnectionEvent | PublisherSpeakingEvent | RecordingEvent | NetworkQualityChangedEvent) => void): Session { | ||
@@ -927,5 +928,16 @@ super.off(type, handler); | ||
/** | ||
* @hidden | ||
*/ | ||
onNetworkQualityChangedChanged(msg): void { | ||
if (msg.connectionId === this.connection.connectionId) { | ||
this.ee.emitEvent('networkQualityChanged', [new NetworkQualityChangedEvent(this, msg.newValue, msg.oldValue, msg.reason)]); | ||
} | ||
} | ||
/** | ||
* @hidden | ||
*/ | ||
recvIceCandidate(msg): void { | ||
@@ -983,3 +995,3 @@ const candidate: RTCIceCandidate = { | ||
logger.warn('Lost connection in Session ' + this.sessionId); | ||
if (!!this.sessionId && !this.connection.disposed) { | ||
if (!!this.sessionId && !!this.connection && !this.connection.disposed) { | ||
this.leave(true, reason); | ||
@@ -986,0 +998,0 @@ } |
@@ -106,3 +106,8 @@ /* | ||
/** | ||
* `"CAMERA"`, `"SCREEN"` or `"CUSTOM"` (the latter when [[PublisherProperties.videoSource]] is a MediaStreamTrack when calling [[OpenVidu.initPublisher]]). | ||
* Can be: | ||
* - `"CAMERA"`: when the video source comes from a webcam. | ||
* - `"SCREEN"`: when the video source comes from screen-sharing. | ||
* - `"CUSTOM"`: when [[PublisherProperties.videoSource]] has been initialized in the Publisher side with a custom MediaStreamTrack when calling [[OpenVidu.initPublisher]]). | ||
* - `"IPCAM"`: when the video source comes from an IP camera participant instead of a regular participant (see [IP cameras](/en/stable/advanced-features/ip-cameras/)). | ||
* | ||
* If [[hasVideo]] is false, this property is undefined | ||
@@ -109,0 +114,0 @@ */ |
@@ -36,3 +36,2 @@ /* | ||
* heartbeat: interval in ms for each heartbeat message, | ||
* sendCloseMessage : true / false, before closing the connection, it sends a closeSession message | ||
* <pre> | ||
@@ -254,3 +253,2 @@ * ws : { | ||
Logger.debug("Closing with code: " + code + " because: " + reason); | ||
if (pingInterval != undefined) { | ||
@@ -262,14 +260,3 @@ Logger.debug("Clearing ping interval"); | ||
enabledPings = false; | ||
if (configuration.sendCloseMessage) { | ||
Logger.debug("Sending close message") | ||
this.send('closeSession', null, function (error, result) { | ||
if (error) { | ||
Logger.error("Error sending close message: " + JSON.stringify(error)); | ||
} | ||
ws.close(code, reason); | ||
}); | ||
} else { | ||
ws.close(code, reason); | ||
} | ||
ws.close(code, reason); | ||
} | ||
@@ -276,0 +263,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3399728
218
32483
3
2