Comparing version 0.14.4 to 0.14.5
@@ -504,2 +504,3 @@ "use strict"; | ||
var uas = new re_invite_user_agent_server_1.ReInviteUserAgentServer(this, message); | ||
this.signalingStateTransition(message); | ||
this.delegate && this.delegate.onInvite ? | ||
@@ -506,0 +507,0 @@ this.delegate.onInvite(uas) : |
@@ -51,5 +51,2 @@ "use strict"; | ||
_this.pubRequestExpires = _this.options.expires; | ||
ua.on("transportCreated", function (transport) { | ||
transport.on("transportError", function () { return _this.onTransportError(); }); | ||
}); | ||
return _this; | ||
@@ -56,0 +53,0 @@ } |
@@ -176,5 +176,3 @@ "use strict"; | ||
_this.registered = false; | ||
ua.on("transportCreated", function (transport) { | ||
transport.on("disconnected", function () { return _this.onTransportDisconnected(); }); | ||
}); | ||
ua.transport.on("disconnected", function () { return _this.onTransportDisconnected(); }); | ||
return _this; | ||
@@ -181,0 +179,0 @@ } |
@@ -109,3 +109,4 @@ /// <reference types="node" /> | ||
private registerContext; | ||
private environListener; | ||
/** Unload listener. */ | ||
private unloadListener; | ||
constructor(configuration?: UA.Options); | ||
@@ -112,0 +113,0 @@ register(options?: any): this; |
@@ -20,3 +20,2 @@ "use strict"; | ||
var Transport_1 = require("./Web/Transport"); | ||
var environment = global.window || global; | ||
/** | ||
@@ -32,2 +31,4 @@ * @class Class creating a SIP User Agent. | ||
var _this = _super.call(this) || this; | ||
/** Unload listener. */ | ||
_this.unloadListener = (function () { _this.stop(); }); | ||
_this.type = Enums_1.TypeStrings.UA; | ||
@@ -373,7 +374,7 @@ _this.log = new core_1.LoggerFactory(); | ||
this.userAgentCore.reset(); | ||
if (typeof environment.removeEventListener === "function") { | ||
// Google Chrome Packaged Apps don't allow 'unload' listeners: | ||
// unload is not available in packaged apps | ||
if (!(global.chrome && global.chrome.app && global.chrome.app.runtime)) { | ||
environment.removeEventListener("unload", this.environListener); | ||
if (this.configuration.autostop) { | ||
// Google Chrome Packaged Apps don't allow 'unload' listeners: unload is not available in packaged apps | ||
var googleChromePackagedApp = typeof chrome !== "undefined" && chrome.app && chrome.app.runtime ? true : false; | ||
if (window && !googleChromePackagedApp) { | ||
window.removeEventListener("unload", this.unloadListener); | ||
} | ||
@@ -389,3 +390,2 @@ } | ||
UA.prototype.start = function () { | ||
var _this = this; | ||
this.logger.log("user requested startup..."); | ||
@@ -412,8 +412,7 @@ if (this.status === Enums_1.UAStatus.STATUS_INIT) { | ||
} | ||
if (this.configuration.autostop && typeof environment.addEventListener === "function") { | ||
// Google Chrome Packaged Apps don't allow 'unload' listeners: | ||
// unload is not available in packaged apps | ||
if (!(global.chrome && global.chrome.app && global.chrome.app.runtime)) { | ||
this.environListener = this.stop; | ||
environment.addEventListener("unload", function () { return _this.environListener(); }); | ||
if (this.configuration.autostop) { | ||
// Google Chrome Packaged Apps don't allow 'unload' listeners: unload is not available in packaged apps | ||
var googleChromePackagedApp = typeof chrome !== "undefined" && chrome.app && chrome.app.runtime ? true : false; | ||
if (window && !googleChromePackagedApp) { | ||
window.addEventListener("unload", this.unloadListener); | ||
} | ||
@@ -420,0 +419,0 @@ } |
@@ -36,3 +36,2 @@ /// <reference types="node" /> | ||
private modifiers; | ||
private WebRTC; | ||
private iceGatheringDeferred; | ||
@@ -39,0 +38,0 @@ private iceGatheringTimeout; |
@@ -42,8 +42,2 @@ "use strict"; | ||
} | ||
var environment = global.window || global; | ||
_this.WebRTC = { | ||
MediaStream: environment.MediaStream, | ||
getUserMedia: environment.navigator.mediaDevices.getUserMedia.bind(environment.navigator.mediaDevices), | ||
RTCPeerConnection: environment.RTCPeerConnection | ||
}; | ||
_this.iceGatheringTimeout = false; | ||
@@ -390,3 +384,3 @@ _this.initPeerConnection(_this.options.peerConnectionOptions); | ||
} | ||
this.peerConnection = new this.WebRTC.RTCPeerConnection(options.rtcConfiguration); | ||
this.peerConnection = new RTCPeerConnection(options.rtcConfiguration); | ||
this.logger.log("New peer connection created"); | ||
@@ -482,3 +476,3 @@ if ("ontrack" in this.peerConnection) { | ||
if (constraints.audio || constraints.video) { | ||
_this.WebRTC.getUserMedia(constraints).then(function (streams) { | ||
navigator.mediaDevices.getUserMedia(constraints).then(function (streams) { | ||
_this.observer.trackAdded(); | ||
@@ -485,0 +479,0 @@ _this.emit("userMedia", streams); |
@@ -57,3 +57,3 @@ "use strict"; | ||
// https://stackoverflow.com/questions/7944460/detect-safari-browser | ||
var browserUa = global.navigator.userAgent.toLowerCase(); | ||
var browserUa = navigator.userAgent.toLowerCase(); | ||
var isSafari = false; | ||
@@ -266,3 +266,3 @@ var isFirefox = false; | ||
if (pc.getReceivers) { | ||
remoteStream = new global.window.MediaStream(); | ||
remoteStream = new MediaStream(); | ||
pc.getReceivers().forEach(function (receiver) { | ||
@@ -300,3 +300,3 @@ var track = receiver.track; | ||
if (pc.getSenders) { | ||
localStream_1 = new global.window.MediaStream(); | ||
localStream_1 = new MediaStream(); | ||
pc.getSenders().forEach(function (sender) { | ||
@@ -303,0 +303,0 @@ var track = sender.track; |
@@ -34,5 +34,5 @@ import { Logger, OutgoingRequestMessage, Transport as TransportBase } from "../core"; | ||
ws: any; | ||
private WebSocket; | ||
private connectionPromise; | ||
private connectDeferredResolve; | ||
private connectDeferredReject; | ||
private connectionTimeout; | ||
@@ -39,0 +39,0 @@ private disconnectionPromise; |
@@ -33,3 +33,2 @@ "use strict"; | ||
var _this = _super.call(this, logger, options) || this; | ||
_this.WebSocket = (global.window || global).WebSocket; | ||
_this.type = Enums_1.TypeStrings.Transport; | ||
@@ -135,2 +134,3 @@ _this.reconnectionAttempts = 0; | ||
_this.connectDeferredResolve = resolve; | ||
_this.connectDeferredReject = reject; | ||
_this.status = TransportStatus.STATUS_CONNECTING; | ||
@@ -148,2 +148,4 @@ _this.emit("connecting"); | ||
reject("Failed to create a websocket"); | ||
_this.connectDeferredResolve = undefined; | ||
_this.connectDeferredReject = undefined; | ||
return; | ||
@@ -153,2 +155,4 @@ } | ||
reject("Unexpected instance websocket not set"); | ||
_this.connectDeferredResolve = undefined; | ||
_this.connectDeferredReject = undefined; | ||
return; | ||
@@ -163,2 +167,4 @@ } | ||
reject("Connection timeout"); | ||
_this.connectDeferredResolve = undefined; | ||
_this.connectDeferredReject = undefined; | ||
}, _this.configuration.connectionTimeout * 1000); | ||
@@ -249,2 +255,4 @@ _this.boundOnOpen = _this.onOpen.bind(_this); | ||
this.connectDeferredResolve({ overrideEvent: true }); | ||
this.connectDeferredResolve = undefined; | ||
this.connectDeferredReject = undefined; | ||
} | ||
@@ -270,5 +278,9 @@ else { | ||
} | ||
if (this.connectDeferredReject) { | ||
this.connectDeferredReject("Websocket Closed"); | ||
} | ||
this.connectionTimeout = undefined; | ||
this.connectionPromise = undefined; | ||
this.connectDeferredResolve = undefined; | ||
this.connectDeferredReject = undefined; | ||
// Check whether the user requested to close. | ||
@@ -275,0 +287,0 @@ if (this.disconnectDeferredResolve) { |
@@ -5,3 +5,3 @@ { | ||
"description": "A simple, intuitive, and powerful JavaScript signaling library", | ||
"version": "0.14.4", | ||
"version": "0.14.5", | ||
"license": "MIT", | ||
@@ -30,3 +30,5 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"crypto-js": "^3.1.9-1" | ||
"@types/node": "^12.0.8", | ||
"crypto-js": "^3.1.9-1", | ||
"tslib": "^1.10.0" | ||
}, | ||
@@ -36,3 +38,2 @@ "devDependencies": { | ||
"@types/jasmine": "^3.3.13", | ||
"@types/node": "^12.0.7", | ||
"circular-dependency-plugin": "^5.0.2", | ||
@@ -47,10 +48,10 @@ "jasmine-core": "^3.4.0", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-webpack": "^3.0.5", | ||
"karma-webpack": "^4.0.2", | ||
"pegjs": "^0.10.0", | ||
"ts-loader": "^6.0.2", | ||
"ts-loader": "^6.0.3", | ||
"ts-pegjs": "0.2.5", | ||
"tslint": "^5.17.0", | ||
"typescript": "^3.5.1", | ||
"webpack": "^4.33.0", | ||
"webpack-cli": "^3.3.3" | ||
"typescript": "^3.5.2", | ||
"webpack": "^4.34.0", | ||
"webpack-cli": "^3.3.4" | ||
}, | ||
@@ -57,0 +58,0 @@ "engines": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
19
3462212
3
61981
+ Added@types/node@^12.0.8
+ Addedtslib@^1.10.0
+ Added@types/node@12.20.55(transitive)
+ Addedtslib@1.14.1(transitive)