openvidu-browser
Advanced tools
Comparing version 1.5.0 to 1.7.0
@@ -13,2 +13,3 @@ import { SessionInternal } from './SessionInternal'; | ||
private secret; | ||
private recorder; | ||
initSession(sessionId: any): SessionInternal; | ||
@@ -24,2 +25,4 @@ initPublisherTagged(parentId: string, cameraOptions: OutboundStreamOptions, newStream: boolean, callback?: Function): Stream; | ||
setSecret(secret: string): void; | ||
getRecorder(): boolean; | ||
setRecorder(recorder: boolean): void; | ||
getOpenViduServerURL(): string; | ||
@@ -26,0 +29,0 @@ getRoom(): SessionInternal; |
@@ -26,2 +26,3 @@ "use strict"; | ||
this.remoteStreams = []; | ||
this.recorder = false; | ||
} | ||
@@ -154,2 +155,8 @@ /* NEW METHODS */ | ||
}; | ||
OpenViduInternal.prototype.getRecorder = function () { | ||
return this.recorder; | ||
}; | ||
OpenViduInternal.prototype.setRecorder = function (recorder) { | ||
this.recorder = recorder; | ||
}; | ||
OpenViduInternal.prototype.getOpenViduServerURL = function () { | ||
@@ -156,0 +163,0 @@ return 'https://' + this.wsUri.split("wss://")[1].split("/room")[0]; |
@@ -26,2 +26,3 @@ "use strict"; | ||
this.remoteStreams = []; | ||
this.recorder = false; | ||
} | ||
@@ -155,2 +156,8 @@ /* NEW METHODS */ | ||
}; | ||
OpenViduInternal.prototype.getRecorder = function () { | ||
return this.recorder; | ||
}; | ||
OpenViduInternal.prototype.setRecorder = function (recorder) { | ||
this.recorder = recorder; | ||
}; | ||
OpenViduInternal.prototype.getOpenViduServerURL = function () { | ||
@@ -157,0 +164,0 @@ return 'https://' + this.wsUri.split("wss://")[1].split("/room")[0]; |
@@ -6,2 +6,3 @@ "use strict"; | ||
var SECRET_PARAM = '?secret='; | ||
var RECORDER_PARAM = '&recorder='; | ||
var SessionInternal = /** @class */ (function () { | ||
@@ -22,3 +23,10 @@ function SessionInternal(openVidu, sessionId) { | ||
SessionInternal.prototype.processOpenViduUrl = function (url) { | ||
this.openVidu.setSecret(this.getSecretFromUrl(url)); | ||
var secret = this.getSecretFromUrl(url); | ||
var recorder = this.getRecorderFromUrl(url); | ||
if (!(secret == null)) { | ||
this.openVidu.setSecret(secret); | ||
} | ||
if (!(recorder == null)) { | ||
this.openVidu.setRecorder(recorder); | ||
} | ||
this.openVidu.setWsUri(this.getFinalUrl(url)); | ||
@@ -29,6 +37,20 @@ }; | ||
if (url.indexOf(SECRET_PARAM) !== -1) { | ||
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, url.length); | ||
var endOfSecret = url.lastIndexOf(RECORDER_PARAM); | ||
if (endOfSecret !== -1) { | ||
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, endOfSecret); | ||
} | ||
else { | ||
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, url.length); | ||
} | ||
} | ||
return secret; | ||
}; | ||
SessionInternal.prototype.getRecorderFromUrl = function (url) { | ||
var recorder = ''; | ||
if (url.indexOf(RECORDER_PARAM) !== -1) { | ||
recorder = url.substring(url.lastIndexOf(RECORDER_PARAM) + RECORDER_PARAM.length, url.length); | ||
} | ||
return new Boolean(recorder).valueOf(); | ||
; | ||
}; | ||
SessionInternal.prototype.getUrlWithoutSecret = function (url) { | ||
@@ -72,2 +94,3 @@ if (!url) { | ||
secret: _this.openVidu.getSecret(), | ||
recorder: _this.openVidu.getRecorder(), | ||
dataChannels: false | ||
@@ -74,0 +97,0 @@ }; |
@@ -35,2 +35,3 @@ import { Stream } from './Stream'; | ||
private getSecretFromUrl(url); | ||
private getRecorderFromUrl(url); | ||
private getUrlWithoutSecret(url); | ||
@@ -37,0 +38,0 @@ private getFinalUrl(url); |
@@ -6,2 +6,3 @@ "use strict"; | ||
var SECRET_PARAM = '?secret='; | ||
var RECORDER_PARAM = '&recorder='; | ||
var SessionInternal = /** @class */ (function () { | ||
@@ -22,3 +23,10 @@ function SessionInternal(openVidu, sessionId) { | ||
SessionInternal.prototype.processOpenViduUrl = function (url) { | ||
this.openVidu.setSecret(this.getSecretFromUrl(url)); | ||
var secret = this.getSecretFromUrl(url); | ||
var recorder = this.getRecorderFromUrl(url); | ||
if (!(secret == null)) { | ||
this.openVidu.setSecret(secret); | ||
} | ||
if (!(recorder == null)) { | ||
this.openVidu.setRecorder(recorder); | ||
} | ||
this.openVidu.setWsUri(this.getFinalUrl(url)); | ||
@@ -29,6 +37,20 @@ }; | ||
if (url.indexOf(SECRET_PARAM) !== -1) { | ||
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, url.length); | ||
var endOfSecret = url.lastIndexOf(RECORDER_PARAM); | ||
if (endOfSecret !== -1) { | ||
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, endOfSecret); | ||
} | ||
else { | ||
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, url.length); | ||
} | ||
} | ||
return secret; | ||
}; | ||
SessionInternal.prototype.getRecorderFromUrl = function (url) { | ||
var recorder = ''; | ||
if (url.indexOf(RECORDER_PARAM) !== -1) { | ||
recorder = url.substring(url.lastIndexOf(RECORDER_PARAM) + RECORDER_PARAM.length, url.length); | ||
} | ||
return new Boolean(recorder).valueOf(); | ||
; | ||
}; | ||
SessionInternal.prototype.getUrlWithoutSecret = function (url) { | ||
@@ -72,2 +94,3 @@ if (!url) { | ||
secret: _this.openVidu.getSecret(), | ||
recorder: _this.openVidu.getRecorder(), | ||
dataChannels: false | ||
@@ -74,0 +97,0 @@ }; |
@@ -36,3 +36,3 @@ { | ||
"types": "lib/OpenVidu/index.d.ts", | ||
"version": "1.5.0" | ||
"version": "1.7.0" | ||
} |
@@ -34,2 +34,3 @@ /* | ||
private secret: string; | ||
private recorder: boolean = false; | ||
@@ -174,2 +175,10 @@ /* NEW METHODS */ | ||
getRecorder() { | ||
return this.recorder; | ||
} | ||
setRecorder(recorder: boolean) { | ||
this.recorder = recorder; | ||
} | ||
getOpenViduServerURL() { | ||
@@ -176,0 +185,0 @@ return 'https://' + this.wsUri.split("wss://")[1].split("/room")[0]; |
@@ -9,2 +9,3 @@ import { Stream, StreamOptionsServer } from './Stream'; | ||
const SECRET_PARAM = '?secret='; | ||
const RECORDER_PARAM = '&recorder='; | ||
@@ -50,3 +51,10 @@ export interface SessionOptions { | ||
private processOpenViduUrl(url: string) { | ||
this.openVidu.setSecret(this.getSecretFromUrl(url)); | ||
let secret = this.getSecretFromUrl(url); | ||
let recorder = this.getRecorderFromUrl(url); | ||
if (!(secret == null)) { | ||
this.openVidu.setSecret(secret); | ||
} | ||
if (!(recorder == null)) { | ||
this.openVidu.setRecorder(recorder); | ||
} | ||
this.openVidu.setWsUri(this.getFinalUrl(url)); | ||
@@ -58,3 +66,8 @@ } | ||
if (url.indexOf(SECRET_PARAM) !== -1) { | ||
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, url.length); | ||
let endOfSecret = url.lastIndexOf(RECORDER_PARAM); | ||
if (endOfSecret !== -1) { | ||
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, endOfSecret); | ||
} else { | ||
secret = url.substring(url.lastIndexOf(SECRET_PARAM) + SECRET_PARAM.length, url.length); | ||
} | ||
} | ||
@@ -64,2 +77,10 @@ return secret; | ||
private getRecorderFromUrl(url: string): boolean { | ||
let recorder = ''; | ||
if (url.indexOf(RECORDER_PARAM) !== -1) { | ||
recorder = url.substring(url.lastIndexOf(RECORDER_PARAM) + RECORDER_PARAM.length, url.length); | ||
} | ||
return new Boolean(recorder).valueOf();; | ||
} | ||
private getUrlWithoutSecret(url: string): string { | ||
@@ -109,2 +130,3 @@ if (!url) { | ||
secret: this.openVidu.getSecret(), | ||
recorder: this.openVidu.getRecorder(), | ||
dataChannels: false | ||
@@ -111,0 +133,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
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
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
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
4498527
46103